Coding method, device, program, and recording medium

ABSTRACT

A coding technology that efficiently codes an input sound signal irrespective of the characteristics thereof and can obtain a decoded sound signal that sounds less artificial to a listener. A coding method codes an input sound signal frame by frame of a predetermined time segment by a selected coding processing from a plurality of types of coding processing in the frequency domain, the coding method makes it possible for a selection unit to select coding processing which is different from the coding processing of the preceding frame as coding processing of the present frame if at least one of the magnitude of the energy of high frequency components of the input sound signal of the preceding frame and the magnitude of the energy of high frequency components of the input sound signal of the present frame is smaller than or equal to a predetermined threshold value.

TECHNICAL FIELD

The present invention relates to a sound signal coding technology. Moreparticularly, the present invention relates to a coding technology ofcoding a sound signal by converting the sound signal into the frequencydomain.

BACKGROUND ART

In coding of sound signals such as speech and music, a method of codingan input sound signal in the frequency domain is widely used. As themethod of coding a sound signal in the frequency domain, there are, forexample, methods of Non-patent Literature 1 and Non-patent Literature 2.

The coding method described in Non-patent Literature 1 is a method thatperforms coding processing using a spectral envelope based oncoefficients which are convertible into linear prediction coefficients.Specifically, the coding method described in Non-patent Literature 1 isa method that obtains a linear prediction coefficient code by codingcoefficients which are obtained from an input sound signal and areconvertible into linear prediction coefficients and obtains a normalizedcoefficient code by coding a normalized coefficient sequence which isobtained by normalizing a frequency domain coefficient sequencecorresponding to the input sound signal by a spectral envelopecoefficient sequence corresponding to coefficients which are convertibleinto quantized linear prediction coefficients corresponding to thelinear prediction coefficient code. The coefficients which areconvertible into linear prediction coefficients are, for example, linearprediction coefficients themselves, PARCOR coefficients (partialautocorrelation coefficients), LSP parameters, or the like.

The coding method described in Non-patent Literature 2 is a method thatperforms coding processing involving differential value variable-lengthcoding by obtaining a differential between the logarithmic value of theaverage energy of coefficients in each frequency domain obtained bydivision and the logarithmic value of the average energy of an adjacentfrequency domain. Specifically, the coding method described inNon-patent Literature 2 is a method that divides a frequency domaincoefficient sequence corresponding to an input sound signal intofrequency domains such that the lower the frequencies are, the smallerthe number of samples of the frequency domain becomes; the higher thefrequencies are, the greater the number of samples of the frequencydomain becomes, obtains the average energy of each frequency domainobtained by division, and quantizes the average energy on thelogarithmic axes; performs variable-length coding on a differentialbetween the value obtained by quantization and the value obtained byquantizing the average energy of an adjacent frequency domain on thelogarithmic axes in a similar manner; and adaptively determines, byusing the average energy, which was quantized on the logarithmic axes,of each frequency domain obtained by division, a quantization bit numberof each frequency domain coefficient and the quantization step width ofeach frequency domain coefficient, quantizes each frequency domaincoefficient in accordance therewith, and further performsvariable-length coding thereon.

PRIOR ART LITERATURE Non-Patent Literature

Non-patent Literature 1: Anthony Vetro, “MPEG Unified Speech and AudioCoding”, Industry and Standards, IEEE MultiMedia, April-June, 2013.

Non-patent Literature 2: M. Bosi and R. E. Goldberg, “Introduction toDigital Audio Coding and Standards”, Kluwer Academic Publishers, 2003.

SUMMARY OF THE INVENTION Problems to be Solved by the Invention

By the coding method of Non-patent Literature 2, since it is possible toreduce the code amount of an average energy code by performingvariable-length coding on an average energy differential if the ascentsand descents of a spectral envelope of an input sound signal are notsteep and the degree of concentration of a spectrum is not high, it ispossible to code the input sound signal efficiently. However, if theascents and descents of a spectral envelope of an input sound signal aresteep and the degree of concentration of a spectrum is high, the codeamount of an average energy code which is obtained by performingvariable-length coding on an average energy differential becomes large.

On the other hand, by the coding method of Non-patent Literature 1,since it is possible to code a spectral envelope efficiently by usingcoefficients which are convertible into linear prediction coefficients,it is possible to code an input sound signal more efficiently than thecoding method of Non-patent Literature 2 if the ascents and descents ofa spectral envelope of the input sound signal are steep and the degreeof concentration of a spectrum is high. However, if the ascents anddescents of a spectral envelope of an input sound signal are not steepand the degree of concentration of a spectrum is not high, it is notpossible to perform coding as efficiently as the coding method ofNon-patent Literature 2.

As described above, the existing coding methods sometimes cannot performcoding efficiently depending on the characteristics of an input soundsignal.

An object of the present invention is to provide a coding method, adevice, a program, and a recording medium that can perform codingefficiently irrespective of the characteristics of an input sound signaland obtain a decoded sound signal that sounds less artificial to alistener.

Means to Solve the Problems

A coding method according to one aspect of the present invention is acoding method that codes an input sound signal frame by frame of apredetermined time segment by a selected coding processing from aplurality of types of coding processing in the frequency domain, thecoding method including: a selection step of making possible a selectionto select coding processing which is different from coding processing ofthe preceding frame as coding processing of the present frame if atleast one of the magnitude of the energy of high frequency components ofan input sound signal of the preceding frame and the magnitude of theenergy of high frequency components of an input sound signal of thepresent frame is smaller than or equal to a predetermined thresholdvalue.

A coding method according to one aspect of the present invention is acoding method that codes an input sound signal frame by frame of apredetermined time segment by a selected coding processing from aplurality of types of coding processing in the frequency domain, thecoding method including: a selection step of making possible a selectionto select coding processing which is different from coding processing ofthe preceding frame as coding processing of the present frame if atleast one of the magnitude of the energy of high frequency components ofan input sound signal of the preceding frame and the magnitude of theenergy of high frequency components of an input sound signal of thepresent frame is smaller than or equal to a predetermined thresholdvalue; otherwise, deciding whether to make possible a selection toselect coding processing which is different from the coding processingof the preceding frame as the coding processing of the present frame orselect the same coding processing as the coding processing of thepreceding frame as the coding processing of the present frame inaccordance with a state in which the high frequency components of theinput sound signal are sparse.

A coding method according to one aspect of the present invention is acoding method that codes an input sound signal frame by frame of apredetermined time segment by a selected coding processing from aplurality of types of coding processing in the frequency domain, thecoding method including: a first coding step of coding a coefficientsequence in the frequency domain corresponding to the input sound signalby using a spectral envelope based on coefficients which are convertibleinto linear prediction coefficients corresponding to the input soundsignal; a second coding step of coding the coefficient sequence in thefrequency domain corresponding to the input sound signal, involvingvariable-length coding which is performed on a differential between thelogarithmic value of the average energy of coefficients in eachfrequency domain obtained by division and the logarithmic value of theaverage energy of an adjacent frequency domain; and a selection step ofmaking possible a selection to code the present frame in the firstcoding step if the ascents and descents of a spectrum of the input soundsignal of the present frame are steep or the degree of concentration ofthe spectrum is high and making possible a selection to code the presentframe in the second coding step if the ascents and descents of thespectrum of the input sound signal of the present frame are gentle orthe degree of concentration of the spectrum is low.

Effects of the Invention

With a configuration that allows any one of a plurality of types ofcoding processing performing coding frame by frame in the frequencydomain to be selected, it is possible to obtain a decoded sound signalthat sounds less artificial to a listener.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram illustrating the configuration of a codingdevice.

FIG. 2 is a block diagram illustrating the configuration of a decodingdevice.

FIG. 3 is a diagram depicting an example of the flow of processing of acoding method.

FIG. 4 is a diagram depicting an example of the flow of processing of aselection unit 380.

FIG. 5 is a diagram depicting an example of the flow of processing of asuitable coding processing judgment unit 382.

FIG. 6 is a diagram depicting an example of the flow of processing of aswitching selection unit 383 of a second embodiment.

FIG. 7 is a diagram depicting an example of the flow of processing of asuitable coding processing judgment unit 382 of a third embodiment.

FIG. 8 is a conceptual diagram of first coding processing and secondcoding processing.

DETAILED DESCRIPTION OF THE EMBODIMENTS First Embodiment

Hereinafter, a first embodiment of the present invention will bedescribed. The first embodiment is configured such that, in aconfiguration in which a coefficient sequence in the frequency domaincorresponding to an input sound signal of each frame is coded by any oneof a plurality of different types of coding processing that performscoding processing in the frequency domain, switching of codingprocessing is performed only when the energy of high frequencycomponents of an input sound signal or/and a coefficient sequence in thefrequency domain corresponding to the input sound signal is small. Theenergy of high frequency components of an input sound signal is themagnitude itself of the energy of high frequency components of an inputsound signal, the magnitude of the energy of high frequency componentsin an input sound signal, or the like.

<Coding Device 300>

The configuration of a coding device 300 is depicted in FIG. 1. Thecoding device 300 includes a frequency domain conversion unit 110, aselection unit 380, a first coding unit 101, and a second coding unit201. The first coding unit 101 includes, for example, a linearprediction analysis coding unit 120, a spectral envelope coefficientsequence generating unit 130, an envelope normalization unit 140, and anormalized coefficient coding unit 150. The second coding unit 201includes, for example, a region division unit 220, an averagelogarithmic energy differential variable-length coding unit 240, and acoefficient coding unit 250. To the coding device 300, a speech sounddigital signal (hereinafter referred to as an input sound signal) in thetime domain is input frame by frame which is a predetermined timesegment, and the following processing is performed on a frame-by-framebasis. Hereinafter, specific processing of each unit will be describedbased on the premise that the present input sound signal is an f-thframe. An input sound signal of the f-th frame is assumed to be x_(f)(n)(n=1, . . . , Nt). Here, Nt represents the number of samples per frame.

Hereinafter, the operation of the coding device 300 will be described.By the coding device 300, processing in each step of a coding methodillustrated in FIG. 3 is performed.

<Frequency Domain Conversion Unit 110>

The frequency domain conversion unit 110 converts the input sound signalx_(f)(n) (n=1, . . . , Nt) into a coefficient sequence in the frequencydomain, for example, an MDCT coefficient sequence X_(f)(n) (n=1, . . . ,N) at point N and outputs the MDCT coefficient sequence X_(f)(n) (n=1, .. . , N) (Step S110). However, N is the number of samples in thefrequency domain and is a positive integer. Conversion into thefrequency domain may be performed by a publicly known conversion methodwhich is not MDCT.

Moreover, if coefficient sequences in the frequency domain obtained at aplurality of degrees of accuracy and by a plurality of methods arenecessary in the first coding unit 101, the second coding unit 201, andthe selection unit 380, it is possible to obtain coefficient sequencesin the frequency domain at a plurality of degrees of accuracy and by aplurality of methods in the frequency domain conversion unit 110. Forexample, when the first coding unit 101 and the second coding unit 201use an MDCT coefficient sequence as a coefficient sequence in thefrequency domain and the selection unit 380 uses a power spectral seriesas a coefficient sequence in the frequency domain, the frequency domainconversion unit 110 simply has to obtain an MDCT coefficient sequenceand a power spectral series from an input sound signal. Furthermore, forexample, when the first coding unit 101 and the second coding unit 201use an MDCT coefficient sequence as a coefficient sequence in thefrequency domain and the selection unit 380 uses a series of energy ofeach frequency band as a coefficient sequence in the frequency domain,the frequency domain conversion unit 110 simply has to obtain an MDCTcoefficient sequence and a series of energy of each frequency band froman input sound signal. In addition, for example, when the first codingunit 101 and the second coding unit 201 use an MDCT coefficient sequenceas a coefficient sequence in the frequency domain, a switchingpermission judgment unit 381 of the selection unit 380 uses a series ofenergy of each frequency band as a coefficient sequence in the frequencydomain, and a suitable coding processing judgment unit 382 of theselection unit 380 uses a power spectral series as a coefficientsequence in the frequency domain, the frequency domain conversion unit110 simply has to obtain an MDCT coefficient sequence, a series ofenergy of each frequency band, and a power spectral series from an inputsound signal.

<Selection Unit 380>

The selection unit 380 makes it possible to select coding processingwhich is different from the coding processing of the preceding frame ascoding processing of the present frame if at least one of the magnitudeof the energy of high frequency components of the input sound signal ofthe preceding frame and the magnitude of the energy of high frequencycomponents of the input sound signal of the present frame is smallerthan a predetermined threshold value (Step S380).

In other words, the selection unit 380 makes a judgment to the effectthat, if at least the energy of high frequency components of an inputsound signal is small, the selection unit 380 allows a coefficientsequence in the frequency domain of the present frame to be coded bycoding processing which is different from the coding processing by whichthe coefficient sequence in the frequency domain of the preceding framewas coded; otherwise, the selection unit 380 does not allow thecoefficient sequence in the frequency domain of the present frame to becoded by coding processing which is different from the coding processingby which the coefficient sequence in the frequency domain of thepreceding frame was coded. The selection unit 380 then performsswitching control such that the coefficient sequence in the frequencydomain of the present frame is coded in accordance with the judgmentresult.

The selection unit 380 includes, for example, the switching permissionjudgment unit 381, the suitable coding processing judgment unit 382, aswitching selection unit 383, and a switching unit 384. Hereinafter, anexample of the selection unit 380 will be described. The selection unit380 performs processing in each step illustrated in FIG. 4.

<Switching Permission Judgment Unit 381>

The switching permission judgment unit 381 judges that, if at least oneof the magnitude of the energy of high frequency components of the inputsound signal of the preceding frame and the magnitude of the energy ofhigh frequency components of the input sound signal of the present frameis smaller than a predetermined threshold value, switching is permitted,that is, judges that the switching permission judgment unit 381 makes itpossible to code the coefficient sequence in the frequency domain of thepresent frame by coding processing which is different from the codingprocessing by which the coefficient sequence in the frequency domain ofthe preceding frame was coded; otherwise, the switching permissionjudgment unit 381 judges that switching is not permitted, that is, theswitching permission judgment unit 381 does not allow the coefficientsequence in the frequency domain of the present frame to be coded bycoding processing which is different from the coding processing by whichthe coefficient sequence in the frequency domain of the preceding framewas coded; the switching permission judgment unit 381 then outputs thejudgment result (Step S381).

Hereinafter, an example of the operation of the switching permissionjudgment unit 381 will be described. First, an example in which the highfrequency energy of an MDCT coefficient sequence is used as themagnitude of the energy of high frequency components of an input soundsignal will be described.

The switching permission judgment unit 381 first obtains the highfrequency energy Eh_(f-1) of an MDCT coefficient sequence X_(f-1)(n)(n=1, . . . , N) of the preceding frame by the following formula (1) andthe high frequency energy Eh_(f) of an MDCT coefficient sequenceX_(f)(n) (n=1, . . . , N) of the present frame by the following formula(2) (Step S3811). In formula (1) and formula (2), M is a predeterminedpositive integer which is smaller than N.

$\begin{matrix}{{Eh}_{f - 1} = {\sum\limits_{n = {N - M}}^{N}\; \left( {X_{f - 1}(n)} \right)^{2}}} & (1) \\{{Eh}_{f} = {\sum\limits_{n = {N - M}}^{N}\; \left( {X_{f}(n)} \right)^{2}}} & (2)\end{matrix}$

The switching permission judgment unit 381 then judges that, if at leastone of the high frequency energy Eh_(f-1) of the preceding frame and thehigh frequency energy Eh_(f) of the present frame is smaller than apredetermined threshold value TH1, that is, Eh_(f-1)<TH1 and/orEh_(f)<TH1, switching is permitted; otherwise, the switching permissionjudgment unit 381 judges that switching is not permitted; the switchingpermission judgment unit 381 then outputs information on whether or notswitching is permitted (Step S3812).

Incidentally, the high frequency energy Eh_(f-1) of the preceding framewhich is obtained in Step S3811 of the present frame is the same as thehigh frequency energy Eh_(f) of the present frame obtained in Step S3811of the preceding frame. Thus, by storing the calculated high frequencyenergy Eh_(f) in the switching permission judgment unit 381 until atleast a frame immediately following the frame, there is no need tocalculate the high frequency energy Eh_(f-1) of the preceding frame.

Next, an example in which the ratio of high frequency energy to thetotal energy of an MDCT coefficient sequence is used as the magnitude ofthe energy of high frequency components of an input sound signal will bedescribed.

The switching permission judgment unit 381 first obtains the ratioEh_(f-1) of high frequency energy to the total energy of an MDCTcoefficient sequence X_(f-1)(n) (n=1, . . . , N) of the preceding frameby the following formula (1A) and the ratio Eh_(f) of high frequencyenergy to the total energy of the MDCT coefficient sequence X_(f)(n)(n=1, . . . , N) of the present frame by the following formula (2A)(Step S3811). In formula (1A) and formula (2A), M is a predeterminedpositive integer.

$\begin{matrix}{{Eh}_{f - 1} = \frac{\sum\limits_{n = {N - M}}^{N}\; \left( {X_{f - 1}(n)} \right)^{2}}{\sum\limits_{n = 1}^{N}\; \left( {X_{f - 1}(n)} \right)^{2}}} & \left( {1A} \right) \\{{Eh}_{f} = \frac{\sum\limits_{n = {N - M}}^{N}\; \left( {X_{f}(n)} \right)^{2}}{\sum\limits_{n = 1}^{N}\; \left( {X_{f}(n)} \right)^{2}}} & \left( {2A} \right)\end{matrix}$

The switching permission judgment unit 381 then judges that, if at leastone of the ratio Eh_(f-1) of high frequency energy to the total energyof the preceding frame and the ratio Eh_(f) of high frequency energy tothe total energy of the present frame is smaller than the predeterminedthreshold value TH1, that is, Eh_(f-1)<TH1 and/or Eh_(f)<TH1, switchingis permitted; otherwise, the switching permission judgment unit 381judges that switching is not permitted; the switching permissionjudgment unit 381 then outputs information on whether or not switchingis permitted (Step S3812).

Incidentally, the ratio Eh_(f-1) of high frequency energy to the totalenergy of the preceding frame which is obtained in Step S3811 of thepresent frame is the same as the ratio Eh_(f) of high frequency energyto the total energy of the present frame obtained in Step S3811 of thepreceding frame. Thus, by storing the calculated ratio Eh_(f) of highfrequency energy to the total energy in the switching permissionjudgment unit 381 until at least a frame immediately following theframe, there is no need to calculate the ratio Eh_(f-1) of highfrequency energy to the total energy of the preceding frame.

Incidentally, in the above-described two examples, it is judged thatswitching is permitted if Eh_(f-1)<TH1 and/or Eh_(f)<TH1; otherwise, itis judged that switching is not permitted, but it may be judged thatswitching is permitted if Eh_(f-1)<TH1 and Eh_(f)<TH1; otherwise, it maybe judged that switching is not permitted. In other words, it may bejudged that, if both the magnitude of the energy of high frequencycomponents of the input sound signal of the preceding frame and themagnitude of the energy of high frequency components of the input soundsignal of the present frame are smaller than a predetermined thresholdvalue, switching is permitted, that is, coding of the coefficientsequence in the frequency domain of the present frame by codingprocessing which is different from the coding processing by which thecoefficient sequence in the frequency domain of the preceding frame wascoded is made possible; otherwise, it may be judged that switching isnot permitted, that is, coding of the coefficient sequence in thefrequency domain of the present frame by coding processing which isdifferent from the coding processing by which the coefficient sequencein the frequency domain of the preceding frame was coded is not allowed.

Moreover, in the above-described examples, high frequency energy and theratio of high frequency energy to the total energy are obtained by usingan MDCT coefficient sequence, but high frequency energy and the ratio ofhigh frequency energy to the total energy may be obtained by using apower spectral series or a series of energy of each frequency band.

<Suitable Coding Processing Judgment Unit 382>

The suitable coding processing judgment unit 382 makes a judgment as towhether a coefficient sequence in the frequency domain corresponding tothe input sound signal of the present frame is suitable for codingprocessing of the first coding unit 101 or coding processing of thesecond coding unit 201 and outputs the judgment result (Step S382).

Hereinafter, an example of the operation of the suitable codingprocessing judgment unit 382 will be described. The suitable codingprocessing judgment unit 382 performs processing in each stepillustrated in FIG. 5. In the following example, the coding processingof the first coding unit 101 is coding processing using a spectralenvelope based on coefficients which are convertible into linearprediction coefficients, which is illustrated in Non-patent Literature1, and the coding processing of the second coding unit 201 is codingprocessing involving variable-length coding which is performed on adifferential between the logarithmic value of the average energy ofcoefficients in each frequency domain obtained by division and thelogarithmic value of the average energy of an adjacent frequency domain,which is illustrated in Non-patent Literature 2.

In this example, if the ascents and descents of a spectral envelope ofan input sound signal are steep or/and the degree of concentration ofthe spectral envelope is high, it is judged that a coefficient sequencein the frequency domain corresponding to the input sound signal of thepresent frame is suitable for the coding processing of the first codingunit 101; if the ascents and descents of a spectral envelope of an inputsound signal are gentle or/and the degree of concentration of thespectral envelope is low, it is judged that the coefficient sequence inthe frequency domain corresponding to the input sound signal of thepresent frame is suitable for the coding processing of the second codingunit 201. The judgment result is then output.

As a method of estimating the ascents and descents and the degree ofconcentration of a spectrum, any method may be adopted; in the followingexample, a configuration in which the depth of the valley of a spectrumor the envelope thereof is estimated will be described. In thisconfiguration, it is judged that the ascents and descents of a spectrumare gentle and the degree of concentration of the spectrum is low if thevalley of the spectrum or the envelope thereof is shallow and that theascents and descents of a spectrum are steep and the degree ofconcentration of the spectrum is high if the valley of the spectrum orthe envelope thereof is deep. The shallow valley of a spectrum or theenvelope thereof translates into a high noise floor. Moreover, the deepvalley of a spectrum or the envelope thereof translates into a low noisefloor.

The suitable coding processing judgment unit 382 first divides the MDCTcoefficient sequence X_(f)(n) (n=1, . . . , N) of the present frame intoQ partial coefficient sequences XS_(f)(1)(n) (n=1, . . . , P),XS_(f)(2)(n) (n=1, . . . , P), . . . , XS_(f)(Q)(n) (n=1, . . . , P),each having P samples (Step S3821). P and Q are positive integers thatsatisfy the relationship P×Q=N. P may be 1. Moreover, here, aconfiguration in which an MDCT coefficient sequence X_(f)(n) (n=1, . . ., N) which is a coefficient sequence in the frequency domain that is tobe subjected to coding processing in the first coding unit 101 or in thesecond coding unit 201 is also used in the suitable coding processingjudgment unit 382 is adopted, but a coefficient sequence in thefrequency domain obtained by conversion into the frequency domain at adifferent degree of accuracy and by a different method from thoseadopted for the MDCT coefficient sequence X_(f)(n) (n=1, . . . , N), forexample, a power spectral series may be used as an object on whichprocessing by the suitable coding processing judgment unit 382 is to beperformed.

The suitable coding processing judgment unit 382 then obtains a seriesAVE_(XS)(q) (q=1, . . . , Q) formed of the mean value of power or thelogarithmic value thereof of each of the partial coefficient sequencesXS_(f)(1)(n) (n=1, . . . , P), XS_(f)(2)(n) (n=1, . . . , P), . . . ,XS_(f)(Q)(n) (n=1, . . . , P) (Step S3822). The mean value of power isAVE_(XS)(q) obtained by formula (3). Moreover, the logarithmic value ofthe mean value of power is AVE_(XS)(q) obtained by formula (3A).

$\begin{matrix}{{{AVE}_{XS}(q)} = \frac{\sum\limits_{n = 1}^{P}\; \left( {{{XS}_{f}(q)}(n)} \right)^{2}}{P}} & (3) \\{{{AVE}_{XS}(q)} = {\log\left( \frac{\sum\limits_{n = 1}^{P}\; \left( {{{XS}_{f}(q)}(n)} \right)^{2}}{P} \right)}} & \left( {3A} \right)\end{matrix}$

The suitable coding processing judgment unit 382 then judges, for eachelement of the series AVE_(XS)(1), AVE_(XS)(2), . . . , AVE_(XS)(Q)formed of the mean value of power or the logarithmic value of the meanvalue of power, whether or not the element is smaller than both of twoadjacent elements and obtains the number of elements judged to besmaller than both of two adjacent elements (Step S3823). That is, thesuitable coding processing judgment unit 382 obtains the number Vally ofq that satisfies formula (4).

AVE _(XS)(q)−min(AVE _(XS)(q−1),AVE _(XS)(q+1))<0  (4)

The suitable coding processing judgment unit 382 then obtains the meanvalue E_(V) of Vally AVE_(XS)(q) corresponding to q that satisfiesformula (4), that is, the mean value E_(V) of the partial regions of thevalley (Step S3824). If AVE_(XS)(q) is the mean value of power, E_(V)obtained in Step S3824 is the mean value of power of the partial regionsin a portion of the valley. If AVE_(XS)(q) is the logarithmic value ofthe mean value of power, E_(V) obtained in Step S3824 is the mean valueof the logarithmic value of the mean value of power of the partialregions in a portion of the valley. Moreover, the suitable codingprocessing judgment unit 382 obtains the mean value of power or thelogarithmic value of the mean value of power of all the partial regions(Step S3825). The mean value of power of all the partial regions is themean value of power of the MDCT coefficient sequence X_(f)(n) (n=1, . .. , N) and is E obtained by formula (11). The logarithmic value of themean value of power of all the partial regions is the logarithmic valueof the mean value of power of the MDCT coefficient sequence X_(f)(n)(n=1, . . . , N) and is E obtained by formula (11A).

$\begin{matrix}{E = \frac{\sum\limits_{n = 1}^{N}\; \left( {X_{f}(n)} \right)^{2}}{N}} & (11) \\{E = {\log\left( \frac{\sum\limits_{n = 1}^{N}\; \left( {X_{f}(n)} \right)^{2}}{N} \right)}} & \left( {11A} \right)\end{matrix}$

The suitable coding processing judgment unit 382 then judges that, sinceit is estimated that the valley of a spectrum is shallow and thespectrum is a spectrum whose spectral envelope has gentle ascents anddescents or whose degree of concentration is low if a difference betweenthe mean value E of AVE_(XS)(q) of all the partial regions and the meanvalue E_(V) of AVE_(XS)(q) of the partial regions of the valley issmaller than or equal to a predetermined threshold value TH2, acoefficient sequence in the frequency domain corresponding to the inputsound signal of the present frame is suitable for the coding processingof the second coding unit 201. Conversely, since it is estimated thatthe valley of a spectrum is deep and the spectrum is a spectrum whosespectral envelope has steep ascents and descents or whose degree ofconcentration is high if a difference between the mean value E ofAVE_(XS)(q) of all the partial regions and the mean value E_(V) ofAVE_(XS)(q) of the partial regions of the valley is greater than thethreshold value TH2, the suitable coding processing judgment unit 382judges that a coefficient sequence in the frequency domain correspondingto the input sound signal of the present frame is suitable for thecoding processing of the first coding unit 101. The suitable codingprocessing judgment unit 382 outputs information on which codingprocessing is suitable (Step S3826). The information on suitable codingprocessing is also referred to as suitability information.

Moreover, in Step S3821, different sample numbers may be adopted fordifferent partial coefficient sequences. For example, the MDCTcoefficient sequence X_(f)(n) (n=1, . . . , N) of the present frame maybe divided into Q partial coefficient sequences XS_(f)(1)(n) (n=1, . . ., P₁), XS_(f)(2)(n) (n=1, . . . , P₂), . . . , XS_(f)(Q)(n) (n=1, . . ., P_(Q)). P₁, P₂, . . . , P_(Q) are positive integers that satisfyP₁+P₂+ . . . +P_(Q)=N. Furthermore, it is preferable that P₁, P₂, . . ., P_(Q) satisfy P₁≦P₂≦ . . . ≦P_(Q). In addition, Q is a positiveinteger.

<Switching Selection Unit 383>

Based on the information on whether or not switching is permitted thatwas obtained by the switching permission judgment unit 381 and theinformation on which coding processing is suitable that was obtained bythe suitable coding processing judgment unit 382, the switchingselection unit 383 selects whether to code the coefficient sequence inthe frequency domain of the present frame in the first coding unit 101or in the second coding unit 201 and outputs a switching code that is acode by which the selected coding processing can be identified (StepS383). The output switching code is input to a decoding device 400.Here, if switching is not permitted, the switching selection unit 383selects to code the coefficient sequence in the frequency domain of thepresent frame by the same coding processing as the coding processing ofthe preceding frame irrespective of the coding processing for which thepresent frame is suitable. Moreover, if switching is permitted, theswitching selection unit 383 selects to code the coefficient sequence inthe frequency domain of the present frame by the coding processing forwhich the present frame is suitable irrespective of the codingprocessing of the preceding frame. However, there may be a case where,even when switching is permitted, the switching selection unit 383selects to code the coefficient sequence in the frequency domain of thepresent frame by the same coding processing as the coding processing ofthe preceding frame, not by the coding processing for which the presentframe is suitable.

Hereinafter, an example of the operation of the switching selection unit383 will be described. In the following example, the coding processingof the first coding unit 101 is coding processing using a spectralenvelope based on coefficients which are convertible into linearprediction coefficients, which is illustrated in Non-patent Literature1, and the coding processing of the second coding unit 201 is codingprocessing involving variable-length coding which is performed on adifferential between the logarithmic value of the average energy ofcoefficients in each frequency domain obtained by division and thelogarithmic value of the average energy of an adjacent frequency domain,which is illustrated in Non-patent Literature 2.

If the information on whether or not switching is permitted that wasobtained by the switching permission judgment unit 381 indicates thatswitching is not permitted and/or the information on which codingprocessing is suitable that was obtained by the suitable codingprocessing judgment unit 382 indicates that the same coding processingas the coding processing performed on the MDCT coefficient sequenceX_(f-1)(n) (n=1, . . . , N) of the preceding frame, the switchingselection unit 383 selects the same coding processing as the codingprocessing performed on the MDCT coefficient sequence X_(f-1)(n) (n=1, .. . , N) of the preceding frame as the coding processing which isperformed on the MDCT coefficient sequence X_(f)(n) (n=1, . . . , N) ofthe present frame.

That is, if the MDCT coefficient sequence X_(f-1)(n) (n=1, . . . , N) ofthe preceding frame was coded in the first coding unit 101 and theinformation on whether or not switching is permitted that was obtainedby the switching permission judgment unit 381 indicates that switchingis not permitted, the switching selection unit 383 selects to code theMDCT coefficient sequence X_(f)(n) (n=1, . . . , N) of the present framealso in the first coding unit 101. Moreover, if the MDCT coefficientsequence X_(f-1)(n) (n=1, . . . , N) of the preceding frame was coded inthe first coding unit 101 and the information on which coding processingis suitable that was obtained by the suitable coding processing judgmentunit 382 indicates the coding processing of the first coding unit 101,the switching selection unit 383 also selects to code the MDCTcoefficient sequence X_(f)(n) (n=1, . . . , N) of the present frame alsoin the first coding unit 101.

Moreover, if the MDCT coefficient sequence X_(f-1)(n) (n=1, . . . , N)of the preceding frame was coded in the second coding unit 201 and theinformation on whether or not switching is permitted that was obtainedby the switching permission judgment unit 381 indicates that switchingis not permitted, the switching selection unit 383 selects to code theMDCT coefficient sequence X_(f)(n) (n=1, . . . , N) of the present framealso in the second coding unit 201. Furthermore, if the MDCT coefficientsequence X_(f-1)(n) (n=1, . . . , N) of the preceding frame was coded inthe second coding unit 201 and the information on which codingprocessing is suitable that was obtained by the suitable codingprocessing judgment unit 382 indicates the coding processing of thesecond coding unit 201, the switching selection unit 383 also selects tocode the MDCT coefficient sequence X_(f)(n) (n=1, . . . , N) of thepresent frame also in the second coding unit 201.

If the information on whether or not switching is permitted that wasobtained by the switching permission judgment unit 381 indicates thatswitching is permitted and the information on which coding processing issuitable that was obtained by the suitable coding processing judgmentunit 382 indicates coding processing which is different from the codingprocessing performed on the MDCT coefficient sequence X_(f-1)(n) (n=1, .. . , N) of the preceding frame, the switching selection unit 383selects the coding processing which is different from the codingprocessing performed on the MDCT coefficient sequence X_(f-1)(n) (n=1, .. . , N) of the preceding frame as coding processing which is performedon the MDCT coefficient sequence X_(f)(n) (n=1, . . . , N) of thepresent frame. That is, if the MDCT coefficient sequence X_(f-1)(n)(n=1, . . . , N) of the preceding frame was coded in the first codingunit 101 and the information on whether or not switching is permittedthat was obtained by the switching permission judgment unit 381indicates that switching is permitted and the information on whichcoding processing is suitable that was obtained by the suitable codingprocessing judgment unit 382 indicates the coding processing of thesecond coding unit 201, the switching selection unit 383 selects to codethe MDCT coefficient sequence X_(f)(n) (n=1, . . . , N) of the presentframe in the second coding unit 201. Moreover, if the MDCT coefficientsequence X_(f-1)(n) (n=1, . . . , N) of the preceding frame was coded inthe second coding unit 201 and the information on whether or notswitching is permitted that was obtained by the switching permissionjudgment unit 381 indicates that switching is permitted and theinformation on which coding processing is suitable that was obtained bythe suitable coding processing judgment unit 382 indicates the codingprocessing of the first coding unit 101, the switching selection unit383 selects to code the MDCT coefficient sequence X_(f)(n) (n=1, . . . ,N) of the present frame in the first coding unit 101.

<Switching Unit 384>

The switching unit 384 performs control so as to input the MDCTcoefficient sequence X_(f)(n) (n=1, . . . , N) output from the frequencydomain conversion unit 110 to the first coding unit 101 or the secondcoding unit 201 such that the MDCT coefficient sequence X_(f)(n) (n=1, .. . , N) of the present frame is coded by the coding processing selectedby the switching selection unit 383 (Step S384). Moreover, if the inputsound signal x_(f)(n) (n=1, . . . , Nt) of the present frame is alsonecessary for coding of the MDCT coefficient sequence X_(f)(n) (n=1, . .. , N) of the present frame, the switching unit 384 also inputs theinput sound signal x_(f)(n) (n=1, . . . , Nt) of the present frame tothe first coding unit 101 or/and the second coding unit 201.

For example, if the coding processing of the first coding unit 101 iscoding processing using a spectral envelope based on coefficients whichare convertible into linear prediction coefficients, which isillustrated in Non-patent Literature 1, and the coding processing of thesecond coding unit 201 is coding processing involving variable-lengthcoding which is performed on a differential between the average energyof coefficients in each frequency domain obtained by division and theaverage energy of an adjacent frequency domain, which is illustrated inNon-patent Literature 2, since the input sound signal x_(f)(n) (n=1, . .. , Nt) of the present frame is necessary only in the first coding unit101, the switching unit 384 also inputs the input sound signal x_(f)(n)(n=1, . . . , Nt) of the present frame to the first coding unit 101 wheninputting the MDCT coefficient sequence X_(f)(n) (n=1, . . . , N) to thefirst coding unit 101.

<First Coding Unit 101, Second Coding Unit 201>

Both the first coding unit 101 and the second coding unit 201 performcoding processing of coding a coefficient sequence in the frequencydomain, but the first coding unit 101 and the second coding unit 201perform different types of coding processing. That is, the first codingunit 101 codes a coefficient sequence in the frequency domain of thepresent frame by coding processing which is different from the codingprocessing of the second coding unit 201 and outputs a first code whichis a code thus obtained (Step S101). Moreover, the second coding unit201 codes a coefficient sequence in the frequency domain of the presentframe by coding processing which is different from the coding processingof the first coding unit 101 and outputs a second code which is a codethus obtained (Step S201). For example, the first coding unit 101performs coding processing using a spectral envelope based oncoefficients which are convertible into linear prediction coefficients,and the second coding unit 201 performs coding processing using theaverage energy of coefficients in each frequency domain obtained bydivision.

Hereinafter, an example of the operation of the first coding unit 101and the second coding unit 201 will be described. In the followingexample, the coding processing of the first coding unit 101 is codingprocessing using a spectral envelope based on coefficients which areconvertible into linear prediction coefficients, which is illustrated inNon-patent Literature 1, and the coding processing of the second codingunit 201 is coding processing involving variable-length coding which isperformed on a differential between the average energy of coefficientsin each frequency domain obtained by division and the average energy ofan adjacent frequency domain, which is illustrated in Non-patentLiterature 2.

In this example, as illustrated on the left side of FIG. 8, first codingprocessing by the first coding unit 101 expresses a spectral envelopeshape in the frequency domain by coefficients which are convertible intolinear prediction coefficients. On the other hand, as illustrated on theright side of FIG. 8, second coding processing by the second coding unit201 expresses an envelope shape by a scale factor band (division of afrequency domain coefficient sequence into a plurality of regions). Itcan be said that the second coding processing is very efficient if themean value changes smoothly because the second coding processing usesvariable-length coding of the differential value of the average heightof each region.

Based on the result of decision or selection made by the selection unit380, one of the processing of the first coding unit 101 and theprocessing of the second coding unit 201, which are a plurality of typesof coding processing in the frequency domain, is performed.

<First Coding Unit 101>

The first coding unit 101 includes the linear prediction analysis codingunit 120, the spectral envelope coefficient sequence generating unit130, the envelope normalization unit 140, and the normalized coefficientcoding unit 150. To the first coding unit 101, the MDCT coefficientsequence X_(f)(n) (n=1, . . . , N) and the input sound signal x_(f)(n)(n=1, . . . , Nt) of the present frame are input, and a first codecontaining a linear prediction coefficient code CL_(f) and a normalizedcoefficient code CN_(f) is output therefrom. The output first code isinput to the decoding device 400. Incidentally, the first coding unit101 is what is obtained by removing, from the coding processingdescribed in Non-patent Literature 1, a portion converting an inputsound signal into a coefficient sequence in the frequency domain. Thatis, the coding processing which is performed in the frequency domainconversion unit 110 and the first coding unit 101 is similar to thecoding processing described in Non-patent Literature 1.

<Linear Prediction Analysis Coding Unit 120>

The linear prediction analysis coding unit 120 obtains coefficientswhich are convertible into linear prediction coefficients by performinglinear prediction analysis on the input sound signal x_(f)(n) (n=1, . .. , Nt), and obtains a linear prediction coefficient code CL_(f) andcoefficients which are convertible into quantized linear predictioncoefficients corresponding to the linear prediction coefficient codeCL_(f) by coding the coefficients which are convertible into linearprediction coefficients and outputs the linear prediction coefficientcode CL_(f) and the coefficients (Step S120). The coefficients which areconvertible into linear prediction coefficients are linear predictioncoefficients themselves, PARCOR coefficients (partial autocorrelationcoefficients), LSP parameters, or the like.

<Spectral Envelope Coefficient Sequence Generating Unit 130>

The spectral envelope coefficient sequence generating unit 130 obtains apower spectral envelope coefficient sequence W_(f)(n) (n=1, . . . , N)corresponding to the coefficients which are convertible into thequantized linear prediction coefficients obtained by the linearprediction analysis coding unit 120 and outputs the power spectralenvelope coefficient sequence W_(f)(n) (n=1, . . . , N) (Step S130).

<Envelope Normalization Unit 140>

The envelope normalization unit 140 normalizes each coefficient X_(f)(n)(n=1, . . . , N) of the MDCT coefficient sequence obtained by thefrequency domain conversion unit 110 by using the power spectralenvelope coefficient sequence W_(f)(n) (n=1, . . . , N) obtained by thespectral envelope coefficient sequence generating unit 130 and outputs anormalized MDCT coefficient sequence XN_(f)(n) (n=1, . . . , N) (StepS140). That is, the envelope normalization unit 140 obtains, as thenormalized MDCT coefficient sequence XN_(f)(n) (n=1, . . . , N), aseries formed of values obtained by dividing each coefficient of theMDCT coefficient sequence X_(f)(n) (n=1, . . . , N) by a correspondingcoefficient contained in the power spectral envelope coefficientsequence W_(f)(n) (n=1, . . . , N).

<Normalized Coefficient Coding Unit 150>

The normalized coefficient coding unit 150 obtains the normalizedcoefficient code CN_(f) by coding the normalized MDCT coefficientsequence XN_(f)(n) (n=1, . . . , N) obtained by the envelopenormalization unit 140 (Step S150).

<Second Coding Unit 201>

Moreover, the second coding unit 201 includes the region division unit220, the average logarithmic energy differential variable-length codingunit 240, and the coefficient coding unit 250. To the second coding unit201, the MDCT coefficient sequence X_(f)(n) (n=1, . . . , N) of thepresent frame is input, and a second code containing an average energycode CA_(f) and a coefficient code CD_(f) is output therefrom. Theoutput second code is input to the decoding device 400. Incidentally,the second coding unit 201 is what is obtained by removing, from thecoding processing described in Non-patent Literature 2, a portionconverting an input sound signal into a coefficient sequence in thefrequency domain. That is, the coding processing which is performed inthe frequency domain conversion unit 110 and the second coding unit 201is similar to the coding processing described in Non-patent Literature2.

<Region Division Unit 220>

The region division unit 220 divides the MDCT coefficient sequenceX_(f)(n) (n=1, . . . , N) obtained by the frequency domain conversionunit 110 into a plurality of partial regions such that the lower thefrequencies of the partial regions are, the smaller the number ofsamples of the partial regions becomes; the higher the frequencies ofthe partial regions are, the greater the number of samples of thepartial regions becomes (Step S220). If the number of partial regions isassumed to be R and the numbers of samples contained in the partialregions are assumed to be S₁, . . . , S_(R), each coefficient X_(f)(n)(n=1, . . . , N) of the MDCT coefficient sequence is divided intopartial regions from the sample at the lowest frequency in order asfollows: XB_(f)(1)(n) (n=1, . . . , S₁), XB_(f)(2)(n) (n=1, . . . , S₂),. . . , XB_(f)(R)(n) (n=1, . . . , S_(R)). R and S₁, . . . , S_(R) arepositive integers. It is assumed that S₁, . . . , S_(R) satisfy therelationship S₁≦S₂≦ . . . ≦S_(R). XB_(f)(1)(n) (n=1, . . . , S₁),XB_(f)(2)(n) (n=1, . . . , S₂), . . . , XB_(f)(R)(n) (n=1, . . . ,S_(R)) is referred to as a partial region coefficient sequence.

<Average Logarithmic Energy Differential Variable-Length Coding Unit240>

The average logarithmic energy differential variable-length coding unit240 obtains, for each partial region obtained by the region divisionunit 220, the average energy of coefficients contained in the partialregion, quantizes each average energy of the partial region on thelogarithmic axes, performs variable-length coding on a difference in thequantization value of the average energy on the logarithmic axes betweenthe adjacent partial regions, and obtains an average energy code CA_(f)(Step S240).

The average logarithmic energy differential variable-length coding unit240 first obtains the average energy E_(XB)(r) (r=1, . . . , R) of eachpartial region r (r=1, . . . , R) by formula (5) (Step S2401).

$\begin{matrix}{{E_{XB}(r)} = \frac{\sum\limits_{n = 1}^{S_{r}}\; \left( {{{XB}_{f}(r)}(n)} \right)^{2}}{S_{r}}} & (5)\end{matrix}$

The average logarithmic energy differential variable-length coding unit240 then performs scalar quantization of the average energy E_(XB)(r)(r=1, . . . , R) in the log domain for each partial region and obtains aquantization value Q(log(E_(XB)(r))) (r=1, . . . , R) of the averageenergy in the log domain (Step S2402). The average logarithmic energydifferential variable-length coding unit 240 then obtains, for eachpartial region, a difference DiffE_(XB)(r) between the quantizationvalue Q(log(E_(XB)(r))) of the average energy in the log domain and thequantization value Q(log(E_(XB)(r−1))) of the average energy in the logdomain, the average energy of the coefficients contained in an adjacentpartial region (Step S2403). However, when r=1, the scalar quantizationvalue Q(log(E_(XB)(r))) itself of the logarithmic value of the averageenergy E_(XB)(1) is used as DiffE_(XB)(1). DiffE_(XB)(r) (r=1, . . . ,R) is referred to as an average logarithmic energy differential. Thatis, DiffE_(XB)(r) (r=1, . . . , R) is obtained by formula (6). However,Q( ) is assumed to be a scalar quantization function and is assumed tobe a function that outputs an integer value which is obtained byrounding off a decimal fraction of a value obtained by normalizing(dividing) an input by a predetermined value.

DiffE _(XB)(r)=Q(log(E _(XB)(r)))−Q(log(E _(XB)(r−1)))(r≧2)

DiffE _(XB)(1)=Q(log(E _(XB)(1)))  (6)

The average logarithmic energy differential variable-length coding unit240 obtains an average energy code CA_(f) by performing variable-lengthcoding on the average logarithmic energy differential DiffE_(XB)(r)(r=1, . . . , R) (Step S2404). Incidentally, since the statisticalfrequency of appearance is high when the absolute value of the averagelogarithmic energy differential DiffE_(XB)(r) is small, thevariable-length code is determined in advance such that the code amountbecomes smaller than that in a case where the absolute value is large.That is, when fluctuations in the average logarithmic energy in eachregion are small, that is, the ascents and descents of a spectralenvelope are gentle, there is a tendency to be capable of shortening thelength of the code of the average energy code CA_(f) if the degree ofconcentration of the spectral envelope is low.

<Coefficient Coding Unit 250>

The coefficient coding unit 250 obtains a coefficient code CD_(f) byperforming, for example, scalar quantization on each coefficient of thepartial region coefficient sequence XB_(f)(1)(n) (n=1, . . . , S₁),XB_(f)(2)(n) (n=1, . . . , S₂), . . . , XB_(f)(R)(n) (n=1, . . . ,S_(R)) obtained by the region division unit 220 by using thequantization value Q(log(E_(XB)(r))) (r=1, . . . , R) of the averageenergy in the log domain obtained by the average logarithmic energydifferential variable-length coding unit 240 (Step S250). Thequantization step width and the quantization bit number which are usedfor this scalar quantization are determined from the quantization valueQ(E_(XB)(r)) (r=1, . . . , R) of the average energy for each partialregion coefficient sequence XB_(f)(1)(n) (n=1, . . . , S₁), XB_(f)(2)(n)(n=1, . . . , S₂), . . . , XB_(f)(R)(n) (n=1, . . . , S_(R)) obtained bythe region division unit 220. Incidentally, the quantization valueQ(E_(XB)(r)) (r=1, . . . , R) of the average energy is obtained byconverting the quantization value Q(log(E_(XB)(r))) (r=1, . . . , R) ofthe average energy in the log domain into a value in the linear domainby formula (7).

Q(E _(XB)(r))=e ^(Q(log(E) ^(XB) ^((r))))  (7)

The coefficient coding unit 250 first distributes the bit number givenas the code amount of the coefficient code CD_(f) to the coefficients ofeach partial region coefficient sequence with consideration given to thequantization value Q(log(E_(XB)(r))) (r=1, . . . , R) of the averageenergy in the log domain corresponding to each region and a value of adifference between that value and the logarithmic value of energy at anauditorily indiscernible spectral level which is estimated by thefrequency (Step S2501).

The coefficient coding unit 250 then determines the step width of scalarquantization of each coefficient of each partial region coefficientsequence from the quantization value Q(E_(XB)(r)) (r=1, . . . , R) ofthe average energy of each partial region and the distributed bit number(Step S2502).

The coefficient coding unit 250 then obtains a coefficient code CD_(f)by quantizing each coefficient of each partial region coefficientsequence by the step width thus determined and the bit number andperforming variable-length coding on the integer value of each quantizedcoefficient (Step S2503).

<Decoding Device 400>

The configuration of the decoding device 400 is depicted in FIG. 2. Thedecoding device 400 includes a switching unit 480, a first decoding unit401, and a second decoding unit 501. The first decoding unit 401includes, for example, a linear prediction decoding unit 420, a spectralenvelope coefficient sequence generating unit 430, a normalizedcoefficient decoding unit 450, and an envelope inverse normalizationunit 440. The second decoding unit 501 includes, for example, an averagelogarithmic energy differential variable-length decoding unit 540 and acoefficient decoding unit 550. To the decoding device 400, a codecontaining a switching code and an input code is input frame by framewhich is a predetermined time segment. In the case of the frame coded inthe first coding unit 101, the input code contains the linear predictioncoefficient code CL_(f) and the normalized coefficient code CN_(f); inthe case of the frame coded in the second coding unit 201, the inputcode contains the average energy code CA_(f) and the coefficient codeCD_(f). Hereinafter, specific processing of each unit will be describedbased on the premise that the frame which is currently being processedis an f-th frame.

Hereinafter, the operation of the decoding device 400 will be described.

<Switching Unit 480>

The switching unit 480 selects whether to decode the input code of thepresent frame in the first decoding unit 401 or in the second decodingunit 501 based on the input switching code and performs control in sucha way as to input the input code to the first decoding unit 401 or thesecond decoding unit 501 such that the selected decoding processing isperformed (Step S480).

Specifically, if the input switching code is a code specifying thecoding processing of the first coding unit 101, that is, a codespecifying the coding processing using a spectral envelope based oncoefficients which are convertible into linear prediction coefficients,the switching unit 480 performs control in such a way as to input theinput code to the first decoding unit 401 that performs decodingprocessing corresponding to the coding processing of the first codingunit 101. Moreover, if the input switching code is a code specifying thecoding processing of the second coding unit 201, that is, a codespecifying the coding processing involving variable-length coding whichis performed on a differential between the average energy ofcoefficients in each frequency domain obtained by division and theaverage energy of an adjacent frequency domain, the switching unit 480performs control in such a way as to input the input code to the seconddecoding unit 501 that performs decoding processing corresponding to thecoding processing of the second coding unit 201.

<First Decoding Unit 401>

The first decoding unit 401 includes the linear prediction decoding unit420, the spectral envelope coefficient sequence generating unit 430, thenormalized coefficient decoding unit 450, and the envelope inversenormalization unit 440. To the first decoding unit 401, the linearprediction coefficient code CL_(f) and the normalized coefficient codeCN_(f) of the present frame are input, and a coefficient sequenceX_(f)(n) (n=1, . . . , N) in the frequency domain is output therefrom.

<Linear Prediction Decoding Unit 420>

The linear prediction decoding unit 420 obtains coefficients which areconvertible into decoded linear prediction coefficients by decoding thelinear prediction coefficient code CL_(f) contained in the input code.The coefficients which are convertible into decoded linear predictioncoefficients are the same as the coefficients which are convertible intothe quantized linear prediction coefficients obtained by the linearprediction analysis coding unit 120 of the coding device 300. Moreover,the decoding processing which is performed by the linear predictiondecoding unit 420 corresponds to the coding processing which isperformed by the linear prediction analysis coding unit 120 of thecoding device 300. Incidentally, the coefficients which are convertibleinto linear prediction coefficients are linear prediction coefficientsthemselves, PARCOR coefficients (partial autocorrelation coefficients),LSP parameters, or the like.

<Spectral Envelope Coefficient Sequence Generating Unit 430>

The spectral envelope coefficient sequence generating unit 430 obtains apower spectral envelope coefficient sequence W_(f)(n) (n=1, . . . , N)corresponding to the coefficients obtained by the linear predictiondecoding unit 420, which are convertible into decoded linear predictioncoefficients, and outputs the power spectral envelope coefficientsequence W_(f)(n) (n=1, . . . , N). However, N is a sample number in thefrequency domain and is a positive integer.

<Normalized Coefficient Decoding Unit 450>

The normalized coefficient decoding unit 450 obtains a decodednormalized MDCT coefficient sequence ̂XN_(f)(n) (n=1, . . . , N) bydecoding the input normalized coefficient code CN_(f) (Step S450). Here,the decoding processing which is performed by the normalized coefficientdecoding unit 450 corresponds to the coding processing which isperformed by the normalized coefficient coding unit 150 of the codingdevice 300. That is, if the conversion processing into the frequencydomain which is not MDCT is performed in the coding device 300,̂XN_(f)(n) (n=1, . . . , N) is a coefficient sequence in the frequencydomain, which is not MDCT, corresponding to the conversion processinginto the frequency domain performed in the coding device 300.Incidentally, although the decoded normalized MDCT coefficient sequencêXN_(f)(n) (n=1, . . . , N) corresponds to the normalized MDCTcoefficient sequence XN_(f)(n) (n=1, . . . , N) input to the normalizedcoefficient coding unit 150 of the coding device 300, since aquantization error is contained in each coefficient, ̂XN_(f)(n) obtainedby adding “{umlaut over ( )}” to XN_(f)(n) is used.

<Envelope Inverse Normalization Unit 440>

The envelope inverse normalization unit 440 performs inversenormalization on each coefficient ̂XN_(f)(n) (n=1, . . . , N) of thedecoded normalized MDCT coefficient sequence obtained by the normalizedcoefficient decoding unit 450 by using the power spectral envelopecoefficient sequence W_(f)(n) (n=1, . . . , N) obtained by the spectralenvelope coefficient sequence generating unit 430, and outputs a decodedMDCT coefficient sequence ̂XN_(f)(n) (n=1, . . . , N) (Step S440). Thatis, the envelope inverse normalization unit 440 obtains a series formedof values obtained by multiplying corresponding coefficients of thecoefficients of the decoded normalized MDCT coefficient sequenceXN_(f)(n) (n=1, . . . , N) and the coefficients of the power spectralenvelope coefficient sequence W_(f)(n) (n=1, . . . , N) as the decodedMDCT coefficient sequence ̂X_(f)(n) (n=1, . . . , N).

<Second Decoding Unit 501>

The second decoding unit 501 includes the average logarithmic energydifferential variable-length decoding unit 540 and the coefficientdecoding unit 550. To the second decoding unit 501, the average energycode CA_(f) and the coefficient code CD_(f) of the present frame areinput, and a coefficient sequence X_(f)(n) (n=1, . . . , N) in thefrequency domain is output therefrom.

<Average Logarithmic Energy Differential Variable-Length Decoding Unit540>

The average logarithmic energy differential variable-length decodingunit 540 obtains a decoded average energy Q(E_(XB)(r)) (r=1, . . . , R)in a partial region by decoding the input average energy code CA_(f)(Step S540). Incidentally, since the decoded average energy is the sameas the quantization value of the average energy obtained in thecoefficient coding unit 250 of the coding device 300, the same symbolQ(E_(XB)(r)) is used.

The average logarithmic energy differential variable-length decodingunit 540 first obtains a difference DiffE_(XB)(r) (r=1, . . . , R) inenergy in the log domain of each partial region by decoding the averageenergy code CA_(f) (Step S5401). Here, the decoding processing which isperformed by the average logarithmic energy differential variable-lengthdecoding unit 540 corresponds to the coding processing which isperformed by the average logarithmic energy differential variable-lengthcoding unit 240 of the coding device 300. Incidentally, since adifference in energy in the log domain of each partial region is thesame as a difference in energy in the log domain of each partial regionwhich is obtained in the average logarithmic energy differentialvariable-length coding unit 240 of the coding device 300, the samesymbol DiffE_(XB)(r) is used.

The average logarithmic energy differential variable-length decodingunit 540 then obtains, for each partial region, a decoded valueQ(log(E_(XB)(r))) of the average energy in the log domain by adding thedifference DiffE_(XB)(r) (r=1, . . . , R) in energy in the log domain toa decoded value Q(log(E_(XB)(r−1))) of the average energy in the logdomain of an adjacent partial region (Step S5402). Incidentally, sincethe decoded value of the average energy in the log domain is the same asthe quantization value of the average energy in the log domain which isobtained in the average logarithmic energy differential variable-lengthcoding unit 240 of the coding device 300, the same symbolQ(log(E_(XB)(r))) is used.

Q(log(E _(XB)(1)))=DiffE _(XB)(1)

Q(log(E _(XB)(r)))=DiffE _(XB)(r)+Q(log(E _(XB)(r−1)))(r≧2)  (8)

The average logarithmic energy differential variable-length decodingunit 540 then obtains what has the decoded value Q(log(E_(XB)(r−1)))(r=1, . . . , R) of the average energy in the log domain as a value inthe linear domain as decoded average energy Q(E_(XB)(r)) (r=1, . . . ,R) (Step S5403).

<Coefficient Decoding Unit 550>

The coefficient decoding unit 550 obtains a decoded coefficient sequencêX_(f)(n) (n=1, . . . , N) by decoding the coefficient code CD_(f) byusing the decoded average energy Q(E_(XB)(r)) (r=1, . . . , R) obtainedin the average logarithmic energy differential variable-length decodingunit 540 (Step S550). Here, the decoding processing which is performedby the coefficient decoding unit 550 corresponds to the codingprocessing which is performed by the coefficient coding unit 250 of thecoding device 300. Since the input coefficient code CD_(f) is what wasobtained by performing variable-length coding on each coefficient ofeach partial region coefficient sequence in the coefficient coding unit250 of the coding device 300, the code length of a code portion of thecoefficient code CD_(f) corresponding to each coefficient can beautomatically reconstituted. Moreover, the quantization step width ofeach region is obtained from the decoded average energy Q(E_(XB)(r))obtained in the average logarithmic energy differential variable-lengthdecoding unit 540. As a result, it is possible to obtain the decodedMDCT coefficient sequence ̂X_(f)(n) (n=1, . . . , N) in the frequencydomain from the coefficient code CD_(f).

<Time Domain Conversion Unit 410>

The time domain conversion unit 410 obtains a decoded sound signal̂x_(f)(n) (n=1, . . . , Nt) by converting a decoded MDCT coefficientsequence ̂X_(f)(n) (n=1, . . . , N) at point N into the time domain andoutputs the decoded sound signal ̂x_(f)(n) (n=1, . . . , Nt) (StepS410). However, Nt is a sample number in the time domain and is apositive integer. If conversion into the frequency domain which is notMDCT is performed in the frequency domain conversion unit 110 of thecoding device 300, it is necessary simply to perform conversionprocessing into the time domain corresponding to that conversionprocessing.

According to the first embodiment, since switching of coding processingand decoding processing can be performed only when the high frequencyenergy of an input sound signal is small, even when a plurality of typesof coding processing and decoding processing which are different in thequantization characteristics of high frequency components are installed,it is possible to obtain a decoded sound signal that sounds lessartificial to a listener.

According to the first embodiment, moreover, since it is possible toselect coding processing suitable for an input sound signal, withoutperforming actual coding, from coding processing using a spectralenvelope based on coefficients which are convertible into linearprediction coefficients and coding processing using the average energyof coefficients in each frequency domain obtained by division, it ispossible to perform coding processing suitable for an input sound signalwith a small arithmetic processing amount.

According to the first embodiment, furthermore, since it is possible toperform coding by selecting coding processing from coding processingusing a spectral envelope based on coefficients which are convertibleinto linear prediction coefficients and coding processing using theaverage energy of coefficients in each frequency domain obtained bydivision, irrespective of whether or not the ascents and descents of aspectrum of an input sound signal are steep and whether or not thedegree of concentration of the spectrum is high, it is possible toperform efficient coding processing regardless of the characteristics ofthe input sound signal.

Second Embodiment

In the first embodiment, a coefficient sequence in the frequency domainof the present frame is always coded by the same coding processing asthe coding processing of the preceding frame when the magnitude of theenergy of high frequency components of an input sound signal is great; asecond embodiment allows a coefficient sequence in the frequency domainof the present frame to be coded by coding processing which is differentfrom the coding processing of the preceding frame depending on the statein which high frequency components of an input sound signal are sparseeven when the magnitude of the energy of the high frequency componentsof the input sound signal is great.

A coding device of the second embodiment makes it possible to selectcoding processing which is different from the coding processing of thepreceding frame as coding processing of the present frame if the energyof high frequency components of an input sound signal is small;otherwise, in accordance with the state in which the high frequencycomponents of the input sound signal are sparse, the coding deviceselects whether to make it possible to select coding processing which isdifferent from the coding processing of the preceding frame as codingprocessing of the present frame or select the same coding processing asthe coding processing of the preceding frame as coding processing of thepresent frame.

The configuration of the coding device of the second embodiment is FIG.1, which is the same as the first embodiment. A coding device 300 of thesecond embodiment is the same as the coding device 300 of the firstembodiment except that processing of the switching permission judgmentunit 381 and the switching selection unit 383 in the selection unit 380is different from that of the coding device 300 of the first embodiment.The configuration of a decoding device of the second embodiment is FIG.2, which is the same as the first embodiment, and processing of eachunit is also the same as that of the decoding device of the firstembodiment. Hereinafter, the switching permission judgment unit 381 andthe switching selection unit 383 in the selection unit 380, whichperform processing different from the processing performed in the codingdevice 300 of the first embodiment, will be described.

<Switching Permission Judgment Unit 381>

The switching permission judgment unit 381 judges that, if at least oneof the magnitude of the energy of high frequency components of the inputsound signal of the preceding frame and the magnitude of the energy ofhigh frequency components of the input sound signal of the present frameis smaller than a predetermined threshold value, switching is permitted,that is, judges that the switching permission judgment unit 381 makes itpossible to code a coefficient sequence in the frequency domain of thepresent frame by coding processing which is different from the codingprocessing by which the coefficient sequence in the frequency domain ofthe preceding frame was coded, and outputs the judgment result (StepS381). Otherwise, the switching permission judgment unit 381 does notmake any judgment such as switching is permitted or switching is notpermitted, and outputs information indicating that any judgment such asswitching is permitted or switching is not permitted has not been madeas the judgment result, or does not output any judgment result. As themagnitude of the energy of high frequency components of an input soundsignal, as is the case with the first embodiment, high frequency energymay be used or the ratio of high frequency energy to the total energymay be used.

<Switching Selection Unit 383>

The switching selection unit 383 selects whether the coefficientsequence in the frequency domain of the present frame is coded in thefirst coding unit 101 or in the second coding unit 201 based on theinformation on whether or not switching is permitted that was obtainedby the switching permission judgment unit 381, the information on whichcoding processing is suitable that was obtained by the suitable codingprocessing judgment unit 382, and the state, which is obtained from theinput sound signal, indicating whether or not the high frequencycomponents of the input sound signal are sparse, and outputs a switchingcode that is a code by which the selected coding processing can beidentified (Step S383B). The output switching code is input to thedecoding device 400.

If the information on whether or not switching is permitted that wasobtained by the switching permission judgment unit 381 indicates thatswitching is permitted, that is, the energy of high frequency componentsof the input sound signal is small, the switching selection unit 383performs the same processing as the switching selection unit 383 of thefirst embodiment. If the information on whether or not switching ispermitted that was obtained by the switching permission judgment unit381 indicates that any judgment such as switching is permitted orswitching is not permitted has not been made or the judgment result isnot input to the switching permission judgment unit 381, that is, if theenergy of high frequency components of the input sound signal is great,the switching selection unit 383 selects whether or not to allow thecoefficient sequence in the frequency domain of the present frame to becoded by coding processing which is different from the coding processingof the preceding frame based on the state, which is obtained from theinput sound signal, indicating whether or not the high frequencycomponents of the input sound signal are sparse.

Hereinafter, of the operation of the switching selection unit 383, adifference from the operation of the switching selection unit 383 of thefirst embodiment, that is, an example of the operation of the switchingselection unit 383 when the energy of the high frequency components ofthe input sound signal is great will be described. In the followingexample, as is the case with the first embodiment, the coding processingof the first coding unit 101 is coding processing using a spectralenvelope based on coefficients which are convertible into linearprediction coefficients, which is illustrated in Non-patent Literature1, and the coding processing of the second coding unit 201 is codingprocessing involving variable-length coding which is performed on adifferential between the logarithmic value of the average energy ofcoefficients in each frequency domain obtained by division and thelogarithmic value of the average energy of an adjacent frequency domain,which is illustrated in Non-patent Literature 2. The switching selectionunit 383 performs processing from Steps S3831B to S3836B of FIG. 6, forexample.

The switching selection unit 383 first divides the MDCT coefficientsequence X_(f)(n) (n=1, . . . , N) of the present frame into Q partialcoefficient sequences XS_(f)(1)(n) (n=1, . . . , P), XS_(f)(2)(n) (n=1,. . . , P), . . . , XS_(f)(Q)(n) (n=1, . . . , P), each having P samples(Step S3831B). P and Q are positive integers that satisfy therelationship P×Q=N. P may be 1. Moreover, here, a configuration in whichthe MDCT coefficient sequence X_(f)(n) (n=1, . . . , N) which is acoefficient sequence in the frequency domain that is to be subjected tocoding processing in the first coding unit 101 or in the second codingunit 201 is also used in the switching selection unit 383 is adopted,but a coefficient sequence in the frequency domain obtained byconversion into the frequency domain at a different degree of accuracyand by a different method from those adopted for the MDCT coefficientsequence X_(f)(n) (n=1, . . . , N), for example, a power spectral seriesmay be used as an object on which processing by the switching selectionunit 383 is to be performed.

The switching selection unit 383 then obtains a series AVE_(XS)(q) (q=1,. . . , Q) formed of the logarithmic value of the mean value of power ofeach of the partial coefficient sequences XS_(f)(1)(n) (n=1, . . . , P),XS_(f)(2)(n) (n=1, . . . , P), . . . , XS_(f)(Q)(n) (n=1, . . . , P)(Step S3832B). The logarithmic value of the mean value of power of eachpartial coefficient sequence is AVE_(XS)(q) which is obtained by formula(3A).

Moreover, the switching selection unit 383 obtains the logarithmic valueof the mean value of power of the MDCT coefficient sequence X_(f)(n)(n=1, . . . , N) (Step S3833B). The logarithmic value of the mean valueof power of the MDCT coefficient sequence is AVE_(Total) which isobtained by formula (9).

$\begin{matrix}{{AVE}_{Total} = {\log\left( \frac{\sum\limits_{n = 1}^{N}\; \left( {X_{f}(n)} \right)^{2}}{N} \right)}} & (9)\end{matrix}$

The switching selection unit 383 then obtains the number of AVE_(XS)(q)in which q satisfies formula (10) within the previously set range ofQ_(Low) (1<Q_(Low)) to Q_(High) (Q_(Low)≦Q_(High)≦Q), that is, thepredetermined range of one or more than one partial region located onthe high frequency side, in other words, the number of regions at thepeak (Step S3834B). μ and λ are positive constants.

AVE _(XS)(q)≧μ·AVE _(Total)+λ  (10)

The switching selection unit 383 then judges that the high frequencycomponents of the input sound signal of the present frame are sparse ifthe number of regions at the peak is smaller than or equal to athreshold value TH3 and judges that the high frequency components of theinput sound signal of the present frame are not sparse if the number ofregions at the peak exceeds the threshold value TH3 (Step S3835B). Here,the threshold value TH3 is a value that is determined by a predeterminedrule such that, if the high frequency components of the input soundsignal of a past frame close to the present frame are sparse, the valuebecomes a value greater than a value which is set when the highfrequency components of the input sound signal of the past frame closeto the present frame are not sparse. For example, if the high frequencycomponents of the input sound signal of the past frame close to thepresent frame are sparse, predetermined TH3_1 is used as the thresholdvalue TH3; if the high frequency components of the input sound signal ofthe past frame close to the present frame are not sparse, predeterminedTH3_2 which is a value smaller than TH3_1 is used as the threshold valueTH3. Here, the past frame close to the present frame is, for example,the preceding frame or the frame before the preceding frame. Thejudgment result as to whether or not the high frequency components ofthe input sound signal of the present frame are sparse is stored in theswitching selection unit 383 until the end of at least two frames afterthe present frame.

The switching selection unit 383 then selects to code the coefficientsequence in the frequency domain of the present frame in either thefirst coding unit 101 or the second coding unit 201 based on the codingprocessing of the preceding frame and the judgment result on the presentframe and the past frame close to the present frame as to whether or notthe high frequency components of the input sound signal are sparse (StepS3836B). That is, the switching selection unit 383 selects whether ornot to allow the coefficient sequence in the frequency domain of thepresent frame to be coded by coding processing which is different fromthe coding processing of the preceding frame.

For example, when the MDCT coefficient sequence X_(f-1)(n) (n=1, . . . ,N) of the preceding frame was coded in the first coding unit 101, if thehigh frequency components of the present frame are not sparse and thehigh frequency components are sparse in at least one of the precedingframe and the frame before the preceding frame, the switching selectionunit 383 makes it possible to select to code the MDCT coefficientsequence X_(f)(n) (n=1, . . . , N) of the present frame in the secondcoding unit 201; otherwise, the switching selection unit 383 selects tocode the MDCT coefficient sequence X_(f)(n) (n=1, . . . , N) of thepresent frame in the first coding unit 101. That is, when the MDCTcoefficient sequence X_(f-1)(n) (n=1, . . . , N) of the preceding framewas coded in the first coding unit 101, if the high frequency componentsof the present frame are not sparse and the high frequency componentsare sparse in at least one of the preceding frame and the frame beforethe preceding frame, the switching selection unit 383 allows thecoefficient sequence in the frequency domain of the present frame to becoded by coding processing which is different from the coding processingof the preceding frame; otherwise, the switching selection unit 383 doesnot allow the coefficient sequence in the frequency domain of thepresent frame to be coded by coding processing which is different fromthe coding processing of the preceding frame.

Moreover, when the MDCT coefficient sequence X_(f-1)(n) (n=1, . . . , N)of the preceding frame was coded in the second coding unit 201, if (1)the high frequency components of the present frame are sparse and thehigh frequency components of the preceding frame are not sparse or (2)the high frequency components of the present frame are sparse, the highfrequency components of the preceding frame are sparse, and the highfrequency components of the frame before the preceding frame are notsparse, the switching selection unit 383 makes it possible to select tocode the MDCT coefficient sequence X_(f)(n) (n=1, . . . , N) of thepresent frame in the first coding unit 101; otherwise, the switchingselection unit 383 selects to code the MDCT coefficient sequenceX_(f)(n) (n=1, . . . , N) of the present frame in the second coding unit201. That is, when the MDCT coefficient sequence X_(f-1)(n) (n=1, . . ., N) of the preceding frame was coded in the second coding unit 201, if(1) the high frequency components of the present frame are sparse andthe high frequency components of the preceding frame are not sparse or(2) the high frequency components of the present frame are sparse, thehigh frequency components of the preceding frame are sparse, and thehigh frequency components of the frame before the preceding frame arenot sparse, the switching selection unit 383 allows the coefficientsequence in the frequency domain of the present frame to be coded bycoding processing which is different from the coding processing of thepreceding frame; otherwise, the switching selection unit 383 does notallow the coefficient sequence in the frequency domain of the presentframe to be coded by coding processing which is different from thecoding processing of the preceding frame.

Incidentally, if the switching selection unit 383 allows the coefficientsequence in the frequency domain of the present frame to be coded bycoding processing which is different from the coding processing of thepreceding frame, the switching selection unit 383 selects the codingprocessing of the coefficient sequence in the frequency domain of thepresent frame based on the information on which coding processing issuitable that was obtained by the suitable coding processing judgmentunit 382. For example, if the switching selection unit 383 allows thecoefficient sequence in the frequency domain of the present frame to becoded by coding processing which is different from the coding processingof the preceding frame, even when the MDCT coefficient sequenceX_(f-1)(n) (n=1, . . . , N) of the preceding frame was coded in thesecond coding unit 201, if the information on which coding processing issuitable that was obtained by the suitable coding processing judgmentunit 382 indicates the coding processing of the first coding unit 101,the switching selection unit 383 selects to code the MDCT coefficientsequence X_(f)(n) (n=1, . . . , N) of the present frame in the firstcoding unit 101. Moreover, if the switching selection unit 383 allowsthe coefficient sequence in the frequency domain of the present frame tobe coded by coding processing which is different from the codingprocessing of the preceding frame, even when the MDCT coefficientsequence X_(f-1)(n) (n=1, . . . , N) of the preceding frame was coded inthe first coding unit 101, if the information on which coding processingis suitable that was obtained by the suitable coding processing judgmentunit 382 indicates the coding processing of the second coding unit 201,the switching selection unit 383 selects to code the MDCT coefficientsequence X_(f)(n) (n=1, . . . , N) of the present frame in the secondcoding unit 201.

Incidentally, even when the switching selection unit 383 allows thecoefficient sequence in the frequency domain of the present frame to becoded by coding processing which is different from the coding processingof the preceding frame, if it is judged that the coefficient sequence inthe frequency domain of the present frame has to be coded by the samecoding processing as the coding processing of the preceding frame basedon the other information obtained by a means that is not depicted in thecoding device 300, the coefficient sequence in the frequency domaincorresponding to the input sound signal of the present frame may becoded by the same coding processing as the coding processing of thepreceding frame.

Moreover, in Step S3831B, different sample numbers may be adopted fordifferent partial coefficient sequences. For example, the MDCTcoefficient sequence X_(f)(n) (n=1, . . . , N) of the present frame maybe divided into Q partial coefficient sequences XS_(f)(1)(n) (n=1, . . ., P₁), XS_(f)(2)(n) (n=1, . . . , P₂), . . . , XS_(f)(Q)(n) (n=1, . . ., P_(Q)). P₁, P₂, . . . , P_(Q) are positive integers that satisfyP₁+P₂+ . . . +P_(Q)=N. Furthermore, it is preferable that P₁, P₂, . . ., P_(Q) satisfy P₁≦P₂≦ . . . ≦P_(Q). Moreover, Q is a positive integer.

Furthermore, if the suitable coding processing judgment unit 382performed the same processing as the processing in Step S3831B, StepS3832B, and Step S3833B, the switching selection unit 383 may use theresult of the processing performed by the suitable coding processingjudgment unit 382 without performing Step S3831B, Step S3832B, and StepS3833B.

Third Embodiment

In the first embodiment and the second embodiment, coding processing forwhich the present frame is suitable is judged by using one thresholdvalue; in a third embodiment, a judgment using two threshold values ismade.

The configuration of a coding device of the third embodiment is FIG. 1,which is the same as the first embodiment. A coding device 300 of thethird embodiment is the same as the coding device 300 of the firstembodiment or the second embodiment except that processing of thesuitable coding processing judgment unit 382 and the switching selectionunit 383 in the selection unit 380 is different from that of the codingdevice 300 of the first embodiment or the second embodiment. Theconfiguration of a decoding device of the third embodiment is FIG. 2,which is the same as the first embodiment, and processing of each unitis also the same as that of the decoding device of the first embodiment.Hereinafter, the suitable coding processing judgment unit 382 and theswitching selection unit 383 in the selection unit 380, which performprocessing different from the processing performed in the coding device300 of the first embodiment, will be described.

<Suitable Coding Processing Judgment Unit 382>

The suitable coding processing judgment unit 382 performs processing ineach step illustrated in FIG. 7. The suitable coding processing judgmentunit 382 judges whether the coefficient sequence in the frequency domaincorresponding to the input sound signal of the present frame is suitablefor the coding processing of the first coding unit 101 or the codingprocessing of the second coding unit 201, in other words, which codingprocessing may be performed, and outputs the judgment result (StepS382A).

Hereinafter, an example of the operation of the suitable codingprocessing judgment unit 382 will be described. The suitable codingprocessing judgment unit 382 performs processing in each stepillustrated in FIG. 7. In the following example, the coding processingof the first coding unit 101 is coding processing using a spectralenvelope based on coefficients which are convertible into linearprediction coefficients, which is illustrated in Non-patent Literature1, and the coding processing of the second coding unit 201 is codingprocessing involving variable-length coding which is performed on adifferential between the logarithmic value of the average energy ofcoefficients in each frequency domain obtained by division and thelogarithmic value of the average energy of an adjacent frequency domain,which is illustrated in Non-patent Literature 2.

In this example, if the ascents and descents of a spectral envelope ofan input sound signal are steep or/and the degree of concentration ofthe spectral envelope is high, the suitable coding processing judgmentunit 382 judges that the coefficient sequence in the frequency domaincorresponding to the input sound signal of the present frame is suitablefor the coding processing of the first coding unit 101; if the ascentsand descents of the spectral envelope of the input sound signal aregentle or/and the degree of concentration of the spectral envelope islow, the suitable coding processing judgment unit 382 judges that thecoefficient sequence in the frequency domain corresponding to the inputsound signal of the present frame is suitable for the coding processingof the second coding unit 201; if the ascents and descents of thespectral envelope of the input sound signal are moderate or/and thedegree of concentration of the spectral envelope is medium, the suitablecoding processing judgment unit 382 judges that either the codingprocessing of the first coding unit 101 or the coding processing of thesecond coding unit 201 may be performed on the coefficient sequence inthe frequency domain corresponding to the input sound signal of thepresent frame, that is, the coefficient sequence in the frequency domaincorresponding to the input sound signal of the present frame is suitablefor both the coding processing of the first coding unit 101 and thecoding processing of the second coding unit 201. The suitable codingprocessing judgment unit 382 then outputs the judgment result.

If the ascents and descents of the spectral envelope of the input soundsignal are moderate or/and the degree of concentration of the spectralenvelope is medium, as will be described later, the switching selectionunit 383 selects to code the coefficient sequence in the frequencydomain of the present frame by the same coding processing as the codingprocessing of the preceding frame. That is, in the switching selectionunit 383, the coding processing of the present frame is selected suchthat switching of the coding processing between the preceding frame andthe present frame does not give the listener a strong feeling ofartificiality. Thus, a case where the ascents and descents of thespectral envelope of the input sound signal are moderate or/and thedegree of concentration of the spectral envelope is medium may includenot only a case where either the coding processing of the first codingunit 101 or the coding processing of the second coding unit 201 may beperformed on the coefficient sequence in the frequency domaincorresponding to the input sound signal of the present frame and a casewhere the coefficient sequence in the frequency domain corresponding tothe input sound signal of the present frame is suitable for both thecoding processing of the first coding unit 101 and the coding processingof the second coding unit 201, but also a case where it is difficult tosay for which of the coding processing of the first coding unit 101 andthe coding processing of the second coding unit 201 the coefficientsequence in the frequency domain corresponding to the input sound signalof the present frame is suitable and a case where there is a possibilitythat the coefficient sequence in the frequency domain corresponding tothe input sound signal of the present frame is not suitable for both thecoding processing of the first coding unit 101 and the coding processingof the second coding unit 201. That is, the above-described judgment“being suitable for both the coding processing of the first coding unit101 and the coding processing of the second coding unit 201” maytranslate into a judgment “it is impossible to judge the suitability forthe coding processing of the first coding unit 101 and the suitabilityfor the coding processing of the second coding unit 201”.

As a method of estimating the ascents and descents and the degree ofconcentration of a spectrum, any method may be adopted, and aconfiguration in which the depth of the valley of a spectral envelope isestimated will be described. In this configuration, if the valley of aspectral envelope is shallow, it is judged that the ascents and descentsof a spectrum are gentle and the degree of concentration of the spectrumis low; if the valley of a spectral envelope is deep, it is judged thatthe ascents and descents of a spectrum are steep and the degree ofconcentration of the spectrum is high; if the depth of the valley of aspectral envelope is medium, it is judged that the ascents and descentsof a spectrum are moderate and the degree of concentration of thespectrum is medium.

The suitable coding processing judgment unit 382 performs Steps S3821 toS3825 which are the same as those of the suitable coding processingjudgment unit 382 of the first embodiment and Step S3826A which isdifferent from the corresponding step of the suitable coding processingjudgment unit 382 of the first embodiment. Hereinafter, a differencefrom the suitable coding processing judgment unit 382 of the firstembodiment will be described.

After Step S3825, the suitable coding processing judgment unit 382performs the following judgment processing using threshold values TH2_1and TH2_2 and output of suitability information which will be describedlater (Step S3826A).

If a difference between the mean value E of AVE_(XS)(q) of all thepartial regions and the mean value E_(V) of AVE_(XS)(q) of the partialregions of the valley is smaller than a predetermined threshold valueTH2_1, since it is estimated that the valley of a spectrum is shallowand the spectrum is a spectrum whose spectral envelope has gentleascents and descents or whose degree of concentration is low, thesuitable coding processing judgment unit 382 judges that the coefficientsequence in the frequency domain corresponding to the input sound signalof the present frame is suitable for the coding processing of the secondcoding unit 201.

Moreover, if a difference between the mean value E of AVE_(XS)(q) of allthe partial regions and the mean value E_(V) of AVE_(XS)(q) of thepartial regions of the valley is greater than a predetermined thresholdvalue TH2_2 which is a value greater than the threshold value TH2_1,since it is estimated that the valley of a spectrum is deep and thespectrum is a spectrum whose spectral envelope has steep ascents anddescents or whose degree of concentration is high, the suitable codingprocessing judgment unit 382 judges that the coefficient sequence in thefrequency domain corresponding to the input sound signal of the presentframe is suitable for the coding processing of the first coding unit101.

Furthermore, if a difference between the mean value E of AVE_(XS)(q) ofall the partial regions and the mean value E_(V) of AVE_(XS)(q) of thepartial regions of the valley is greater than or equal to the thresholdvalue TH2_1 but smaller than or equal to the threshold value TH2_2,since it is estimated that the depth of the valley of a spectrum ismedium and the spectrum is a spectrum whose spectral envelope hasmoderate ascents and descents or whose degree of concentration ismedium, the suitable coding processing judgment unit 382 may performeither the coding processing of the first coding unit 101 or the codingprocessing of the second coding unit 201 on the coefficient sequence inthe frequency domain corresponding to the input sound signal of thepresent frame. That is, the suitable coding processing judgment unit 382judges that the coefficient sequence in the frequency domaincorresponding to the input sound signal of the present frame is suitablefor both the coding processing of the first coding unit 101 and thecoding processing of the second coding unit 201.

Then, the suitable coding processing judgment unit 382 outputssuitability information which is information on suitable codingprocessing. The suitability information is the judgment result of thesuitable coding processing judgment unit 382 and it can be said that thesuitability information is information on which of the coding processingof the first coding unit 101 and the coding processing of the secondcoding unit 201 is suitable or information as to whether or not both thecoding processing of the first coding unit 101 and the coding processingof the second coding unit 201 are suitable.

Incidentally, the suitable coding processing judgment unit 382 mayoutput information indicating that the coefficient sequence in thefrequency domain corresponding to the input sound signal of the presentframe is suitable for the coding processing of the first coding unit 101or information indicating that the coefficient sequence in the frequencydomain corresponding to the input sound signal of the present frame issuitable for the coding processing of the second coding unit 201 onlywhen it is judged that the coefficient sequence in the frequency domaincorresponding to the input sound signal of the present frame is suitablefor any one of the coding processing of the first coding unit 101 andthe coding processing of the second coding unit 201 and perform any oneof the coding processing of the first coding unit 101 and the codingprocessing of the second coding unit 201 on the coefficient sequence inthe frequency domain corresponding to the input sound signal of thepresent frame. That is, a configuration may be adopted in which thejudgment result is not output if it is judged that the coefficientsequence in the frequency domain corresponding to the input sound signalof the present frame is suitable for both the coding processing of thefirst coding unit 101 and the coding processing of the second codingunit 201.

<Switching Selection Unit 383>

Based on the information on whether or not switching is permitted thatwas obtained by the switching permission judgment unit 381 and theinformation, which was obtained by the suitable coding processingjudgment unit 382, on which of the coding processing of the first codingunit 101 and the coding processing of the second coding unit 201 issuitable or the information as to whether or not both the codingprocessing of the first coding unit 101 and the coding processing of thesecond coding unit 201 are suitable, that is, the information(suitability information) on suitable coding processing, the switchingselection unit 383 selects whether to code the coefficient sequence inthe frequency domain of the present frame in the first coding unit 101or in the second coding unit 201 and outputs a switching code that is acode by which the selected coding processing can be identified (StepS383A). The output switching code is input to the decoding device 400.Here, if switching is not permitted, irrespective of the codingprocessing for which the present frame is suitable, the switchingselection unit 383 selects to code the coefficient sequence in thefrequency domain of the present frame by the same coding processing asthe coding processing of the preceding frame. Moreover, if switching ispermitted and the present frame is suitable for both the codingprocessing of the first coding unit 101 and the coding processing of thesecond coding unit 201, the switching selection unit 383 selects to codethe coefficient sequence in the frequency domain of the present frame bythe same coding processing as the coding processing of the precedingframe. Furthermore, if switching is permitted and the present frame issuitable for any one of the coding processing of the first coding unit101 and the coding processing of the second coding unit 201,irrespective of the coding processing of the preceding frame, theswitching selection unit 383 selects to code the coefficient sequence inthe frequency domain of the present frame by the coding processing forwhich the present frame is suitable.

Hereinafter, an example of the operation of the switching selection unit383 will be described. In the following example, the coding processingof the first coding unit 101 is coding processing using a spectralenvelope based on coefficients which are convertible into linearprediction coefficients, which is illustrated in Non-patent Literature1, and the coding processing of the second coding unit 201 is codingprocessing involving variable-length coding which is performed on adifferential between the logarithmic value of the average energy ofcoefficients in each frequency domain obtained by division and thelogarithmic value of the average energy of an adjacent frequency domain,which is illustrated in Non-patent Literature 2.

If the information on whether or not switching is permitted that wasobtained by the switching permission judgment unit 381 indicates thatswitching is not permitted and/or the information (suitabilityinformation) on which coding processing is suitable that was obtained bythe suitable coding processing judgment unit 382 indicates the samecoding processing as the coding processing performed on the MDCTcoefficient sequence X_(f-1)(n) (n=1, . . . , N) of the preceding frameor indicates that both the coding processing of the first coding unit101 and the coding processing of the second coding unit 201 aresuitable, the switching selection unit 383 selects the same codingprocessing as the coding processing performed on the MDCT coefficientsequence X_(f-1)(n) (n=1, . . . , N) of the preceding frame as thecoding processing which is performed on the MDCT coefficient sequenceX_(f)(n) (n=1, . . . , N) of the present frame.

That is, if the MDCT coefficient sequence X_(f-1)(n) (n=1, . . . , N) ofthe preceding frame was coded in the first coding unit 101 and theinformation on whether or not switching is permitted that was obtainedby the switching permission judgment unit 381 indicates that switchingis not permitted, the switching selection unit 383 selects to code theMDCT coefficient sequence X_(f)(n) (n=1, . . . , N) of the present framealso in the first coding unit 101. Moreover, if the MDCT coefficientsequence X_(f-1)(n) (n=1, . . . , N) of the preceding frame was coded inthe first coding unit 101 and the information (suitability information)on which coding processing is suitable that was obtained by the suitablecoding processing judgment unit 382 indicates the coding processing ofthe first coding unit 101, the switching selection unit 383 selects tocode the MDCT coefficient sequence X_(f)(n) (n=1, . . . , N) of thepresent frame also in the first coding unit 101. Furthermore, if theMDCT coefficient sequence X_(f-1)(n) (n=1, . . . , N) of the precedingframe was coded in the first coding unit 101 and the information(suitability information) on which coding processing is suitable thatwas obtained by the suitable coding processing judgment unit 382indicates that both the coding processing of the first coding unit 101and the coding processing of the second coding unit 201 are suitable,the switching selection unit 383 selects to code the MDCT coefficientsequence X_(f)(n) (n=1, . . . , N) of the present frame also in thefirst coding unit 101.

Moreover, if the MDCT coefficient sequence X_(f-1)(n) (n=1, . . . , N)of the preceding frame was coded in the second coding unit 201 and theinformation on whether or not switching is permitted that was obtainedby the switching permission judgment unit 381 indicates that switchingis not permitted, the switching selection unit 383 selects to code theMDCT coefficient sequence X_(f)(n) (n=1, . . . , N) of the present framealso in the second coding unit 201. Furthermore, if the MDCT coefficientsequence X_(f-1)(n) (n=1, . . . , N) of the preceding frame was coded inthe second coding unit 201 and the information (suitability information)on which coding processing is suitable that was obtained by the suitablecoding processing judgment unit 382 indicates the coding processing ofthe second coding unit 201, the switching selection unit 383 selects tocode the MDCT coefficient sequence X_(f)(n) (n=1, . . . , N) of thepresent frame also in the second coding unit 201. In addition, if theMDCT coefficient sequence X_(f-1)(n) (n=1, . . . , N) of the precedingframe was coded in the second coding unit 201 and the information(suitability information) on which coding processing is suitable thatwas obtained by the suitable coding processing judgment unit 382indicates that both the coding processing of the first coding unit 101and the coding processing of the second coding unit 201 are suitable,the switching selection unit 383 selects to code the MDCT coefficientsequence X_(f)(n) (n=1, . . . , N) of the present frame also in thesecond coding unit 201.

If the information on whether or not switching is permitted that wasobtained by the switching permission judgment unit 381 indicates thatswitching is permitted and the information (suitability information) onwhich coding processing is suitable that was obtained by the suitablecoding processing judgment unit 382 indicates coding processing which isdifferent from the coding processing performed on the MDCT coefficientsequence X_(f-1)(n) (n=1, . . . , N) of the preceding frame, theswitching selection unit 383 selects the coding processing which isdifferent from the coding processing performed on the MDCT coefficientsequence X_(f-1)(n) (n=1, . . . , N) of the preceding frame as thecoding processing which is performed on the MDCT coefficient sequenceX_(f)(n) (n=1, . . . , N) of the present frame. That is, if the MDCTcoefficient sequence X_(f-1)(n) (n=1, . . . , N) of the preceding framewas coded in the first coding unit 101, the information on whether ornot switching is permitted that was obtained by the switching permissionjudgment unit 381 indicates that switching is permitted, and theinformation (suitability information) on which coding processing issuitable that was obtained by the suitable coding processing judgmentunit 382 indicates the coding processing of the second coding unit 201,the switching selection unit 383 selects to code the MDCT coefficientsequence X_(f)(n) (n=1, . . . , N) of the present frame in the secondcoding unit 201. Moreover, if the MDCT coefficient sequence X_(f-1)(n)(n=1, . . . , N) of the preceding frame was coded in the second codingunit 201, the information on whether or not switching is permitted thatwas obtained by the switching permission judgment unit 381 indicatesthat switching is permitted, and the information (suitabilityinformation) on which coding processing is suitable that was obtained bythe suitable coding processing judgment unit 382 indicates the codingprocessing of the first coding unit 101, the switching selection unit383 selects to code the MDCT coefficient sequence X_(f)(n) (n=1, . . . ,N) of the present frame in the first coding unit 101.

Incidentally, if the suitable coding processing judgment unit 382 isconfigured so as not to output the judgment result if it is judged thatthe coefficient sequence in the frequency domain corresponding to theinput sound signal of the present frame is suitable for both the codingprocessing of the first coding unit 101 and the coding processing of thesecond coding unit 201, the switching selection unit 383 simply has toperform, if the information on suitable coding processing is not inputthereto, processing which is performed when the above-describedinformation (suitability information) on which coding processing issuitable indicates that both the coding processing of the first codingunit 101 and the coding processing of the second coding unit 201 aresuitable.

First Modification

As a judgment as to whether the input sound signal of the present frameis suitable for the coding processing using a spectral envelope based oncoefficients which are convertible into linear prediction coefficients,which is illustrated in Non-patent Literature 1, or the codingprocessing involving variable-length coding which is performed on adifferential between the logarithmic value of the average energy ofcoefficients in each frequency domain obtained by division and thelogarithmic value of the average energy of an adjacent frequency domain,which is illustrated in Non-patent Literature 2, a judgment includingnot only the magnitude of the ascents and descents of a spectralenvelope of the input sound signal and the degree of concentration ofthe spectral envelope, but also the other information may be made.

For example, even when the coefficient sequence in the frequency domaincorresponding to the input sound signal of the preceding frame was codedby the first coding unit 101, the switching permission judgment unit 381judges that switching is permitted, and the suitable coding processingjudgment unit 382 judges that the coefficient sequence in the frequencydomain corresponding to the input sound signal of the present frame issuitable for the coding processing of the second coding unit 201, if itis judged that the coefficient sequence in the frequency domaincorresponding to the input sound signal of the present frame has to becoded by the coding processing of the first coding unit 101 based on theother information obtained by a means which is not depicted in thecoding device 300, the coefficient sequence in the frequency domaincorresponding to the input sound signal of the present frame may becoded by the first coding unit 101. That is, the coding device 300simply has to be configured so as to make it possible to select to codethe coefficient sequence in the frequency domain corresponding to theinput sound signal of the present frame by the second coding unit 201 ifthe coefficient sequence in the frequency domain corresponding to theinput sound signal of the preceding frame was coded by the first codingunit 101, the switching permission judgment unit 381 judges thatswitching is permitted, and the suitable coding processing judgment unit382 judges that the coefficient sequence in the frequency domaincorresponding to the input sound signal of the present frame is suitablefor the coding processing of the second coding unit 201.

Moreover, conversely, even when the coefficient sequence in thefrequency domain corresponding to the input sound signal of thepreceding frame was coded by the second coding unit 201, the switchingpermission judgment unit 381 judges that switching is permitted, and thesuitable coding processing judgment unit 382 judges that the coefficientsequence in the frequency domain corresponding to the input sound signalof the present frame is suitable for the coding processing of the firstcoding unit 101, if it is judged that the coefficient sequence in thefrequency domain corresponding to the input sound signal of the presentframe has to be coded by the coding processing of the second coding unit201 based on the other information obtained by a means which is notdepicted in the coding device 300, the coefficient sequence in thefrequency domain corresponding to the input sound signal of the presentframe may be coded by the second coding unit 201. That is, the codingdevice 300 simply has to be configured so as to make it possible toselect to code the coefficient sequence in the frequency domaincorresponding to the input sound signal of the present frame by thefirst coding unit 101 if the coefficient sequence in the frequencydomain corresponding to the input sound signal of the preceding framewas coded by the second coding unit 201, the switching permissionjudgment unit 381 judges that switching is permitted, and the suitablecoding processing judgment unit 382 judges that the coefficient sequencein the frequency domain corresponding to the input sound signal of thepresent frame is suitable for the coding processing of the first codingunit 101.

Furthermore, for example, in the coding device 300 of the thirdembodiment, even when the coefficient sequence in the frequency domaincorresponding to the input sound signal of the preceding frame was codedby the first coding unit 101 and the suitable coding processing judgmentunit 382 judges that the coefficient sequence in the frequency domaincorresponding to the input sound signal of the present frame is suitablefor both the coding processing of the first coding unit 101 and thecoding processing of the second coding unit 201, if the switchingpermission judgment unit 381 judges that switching is permitted and itis judged that the coefficient sequence in the frequency domaincorresponding to the input sound signal of the present frame has to becoded by the coding processing of the second coding unit 201 based onthe other information obtained by a means which is not depicted in thecoding device 300, the coefficient sequence in the frequency domaincorresponding to the input sound signal of the present frame may becoded by the second coding unit 201.

Moreover, conversely, even when the coefficient sequence in thefrequency domain corresponding to the input sound signal of thepreceding frame was coded by the second coding unit 201 and the suitablecoding processing judgment unit 382 judges that the coefficient sequencein the frequency domain corresponding to the input sound signal of thepresent frame is suitable for both the coding processing of the firstcoding unit 101 and the coding processing of the second coding unit 201,if the switching permission judgment unit 381 judges that switching ispermitted and it is judged that the coefficient sequence in thefrequency domain corresponding to the input sound signal of the presentframe has to be coded by the coding processing of the first coding unit101 based on the other information obtained by a means which is notdepicted in the coding device 300, the coefficient sequence in thefrequency domain corresponding to the input sound signal of the presentframe may be coded by the first coding unit 101.

That is, the coding device 300 of the third embodiment simply has to beconfigured so as to make it possible to select to code the coefficientsequence in the frequency domain corresponding to the input sound signalof the present frame by the same coding processing as the codingprocessing of the preceding frame if the switching permission judgmentunit 381 judges that switching is permitted and the suitable codingprocessing judgment unit 382 judges that the coefficient sequence in thefrequency domain corresponding to the input sound signal of the presentframe is suitable for both the coding processing of the first codingunit 101 and the coding processing of the second coding unit 201.

Second Modification

For a selection as to whether to code the coefficient sequence in thefrequency domain of the present frame in the first coding unit 101 or inthe second coding unit 201, the information on whether or not switchingis permitted that was obtained by the switching permission judgment unit381 may not be used. In this case, the switching permission judgmentunit 381 does not have to be provided in the selection unit 380.

In this case, the switching selection unit 383 selects whether to codethe coefficient sequence in the frequency domain of the present frame inthe first coding unit 101 or in the second coding unit 201 based on thesuitability information obtained by the suitable coding processingjudgment unit 382 without using the information on whether or notswitching is permitted that was obtained by the switching permissionjudgment unit 381, and outputs a switching code that is a code by whichthe selected coding processing can be identified.

For example, it is necessary simply to code the coefficient sequence inthe frequency domain corresponding to the input sound signal of thepresent frame by the first coding unit 101 if the suitable codingprocessing judgment unit 382 judges that the coefficient sequence in thefrequency domain corresponding to the input sound signal of the presentframe is suitable for the coding processing of the first coding unit 101and code the coefficient sequence in the frequency domain correspondingto the input sound signal of the present frame by the second coding unit201 if the suitable coding processing judgment unit 382 judges that thecoefficient sequence in the frequency domain corresponding to the inputsound signal of the present frame is suitable for the coding processingof the second coding unit 201.

Also in this case, as is the case with the first modification, ajudgment including the other information may be made. For example, evenwhen the suitable coding processing judgment unit 382 judges that thecoefficient sequence in the frequency domain corresponding to the inputsound signal of the present frame is suitable for the coding processingof the first coding unit 101, if it is judged that the coefficientsequence in the frequency domain corresponding to the input sound signalof the present frame has to be coded by the coding processing of thesecond coding unit 201 based on the other information obtained by ameans which is not depicted in the coding device 300, the coefficientsequence in the frequency domain corresponding to the input sound signalof the present frame may be coded by the second coding unit 201.

Conversely, even when the suitable coding processing judgment unit 382judges that the coefficient sequence in the frequency domaincorresponding to the input sound signal of the present frame is suitablefor the coding processing of the second coding unit 201, if it is judgedthat the coefficient sequence in the frequency domain corresponding tothe input sound signal of the present frame has to be coded by thecoding processing of the first coding unit 101 based on the otherinformation obtained by a means which is not depicted in the codingdevice 300, the coefficient sequence in the frequency domaincorresponding to the input sound signal of the present frame may becoded by the first coding unit 101.

That is, a configuration simply has to be a configuration that makes itpossible to select to code the coefficient sequence in the frequencydomain corresponding to the input sound signal of the present frame bythe coding processing of the first coding unit 101 if the suitablecoding processing judgment unit 382 judges that the coefficient sequencein the frequency domain corresponding to the input sound signal of thepresent frame is suitable for the coding processing of the first codingunit 101. Moreover, a configuration simply has to be a configurationthat makes it possible to select to code the coefficient sequence in thefrequency domain corresponding to the input sound signal of the presentframe by the coding processing of the second coding unit 201 if thesuitable coding processing judgment unit 382 judges that the coefficientsequence in the frequency domain corresponding to the input sound signalof the present frame is suitable for the coding processing of the secondcoding unit 201.

Furthermore, for example, in the coding device 300 of the thirdembodiment, of cases where the suitable coding processing judgment unit382 judges that the coefficient sequence in the frequency domaincorresponding to the input sound signal of the present frame is suitablefor both the coding processing of the first coding unit 101 and thecoding processing of the second coding unit 201, in a case where it isjudged that the coefficient sequence in the frequency domaincorresponding to the input sound signal of the present frame has to becoded by the coding processing of the first coding unit 101 based on theother information obtained by a means which is not depicted in thecoding device 300, the coefficient sequence in the frequency domaincorresponding to the input sound signal of the present frame may becoded by the first coding unit 101.

Moreover, of cases where the suitable coding processing judgment unit382 judges that the coefficient sequence in the frequency domaincorresponding to the input sound signal of the present frame is suitablefor both the coding processing of the first coding unit 101 and thecoding processing of the second coding unit 201, in a case where it isjudged that the coefficient sequence in the frequency domaincorresponding to the input sound signal of the present frame has to becoded by the coding processing of the second coding unit 201 based onthe other information obtained by a means which is not depicted in thecoding device 300, the coefficient sequence in the frequency domaincorresponding to the input sound signal of the present frame may becoded by the second coding unit 201.

That is, the coding device 300 of the third embodiment simply has to beconfigured so as to make it possible to select to code the coefficientsequence in the frequency domain corresponding to the input sound signalof the present frame by the same coding processing as the codingprocessing of the preceding frame if the suitable coding processingjudgment unit 382 judges that the coefficient sequence in the frequencydomain corresponding to the input sound signal of the present frame issuitable for both the coding processing of the first coding unit 101 andthe coding processing of the second coding unit 201.

Incidentally, in a comparison between the calculated value and thethreshold value in the above-described embodiments, settings simply haveto be made such that, if the calculated value is the same value as thethreshold value, the calculated value is classified into any one of twocases adjacent to each other with the threshold value placedtherebetween as a boundary. That is, a condition that a value is greaterthan or equal to a certain threshold value may translate into acondition that a value is greater than that threshold value and acondition that a value is smaller than that threshold value maytranslate into a condition that a value is smaller than or equal to thatthreshold value. Moreover, a condition that a value is greater than acertain threshold value may translate into a condition that a value isgreater than or equal to that threshold value and a condition that avalue is smaller than or equal to that threshold value may translateinto a condition that a value is smaller than that threshold value.

For example, in the first embodiment, the selection unit 380 may make itpossible to select coding processing which is different from the codingprocessing of the preceding frame as the coding processing of thepresent frame if at least one of the magnitude of the energy of highfrequency components of the input sound signal of the preceding frameand the magnitude of the energy of high frequency components of theinput sound signal of the present frame is smaller than or equal to apredetermined threshold value (Step S380).

Moreover, in the second embodiment, the switching permission judgmentunit 381 may judge that switching is permitted, that is, the switchingpermission judgment unit 381 makes it possible to code the coefficientsequence in the frequency domain of the present frame by codingprocessing which is different from the coding processing by which thecoefficient sequence in the frequency domain of the preceding frame wascoded if at least one of the magnitude of the energy of high frequencycomponents of the input sound signal of the preceding frame and themagnitude of the energy of high frequency components of the input soundsignal of the present frame is smaller than or equal to a predeterminedthreshold value and output the judgment result.

Furthermore, in the first embodiment, if a difference between the meanvalue E of AVE_(XS)(q) of all the partial regions and the mean valueE_(V) of AVE_(XS)(q) of the partial regions of the valley is smallerthan the predetermined threshold value TH2, since it is estimated thatthe valley of a spectrum is shallow and the spectrum is a spectrum whosespectral envelope has gentle ascents and descents or whose degree ofconcentration is low, the suitable coding processing judgment unit 382may judge that the coefficient sequence in the frequency domaincorresponding to the input sound signal of the present frame is suitablefor the coding processing of the second coding unit 201. Conversely, ifa difference between the mean value E of AVE_(XS)(q) of all the partialregions and the mean value E_(V) of AVE_(XS)(q) of the partial regionsof the valley is greater than or equal to the threshold value TH2, sinceit is estimated that the valley of a spectrum is deep and the spectrumis a spectrum whose spectral envelope has steep ascents and descents orwhose degree of concentration is high, the suitable coding processingjudgment unit 382 may judge that the coefficient sequence in thefrequency domain corresponding to the input sound signal of the presentframe is suitable for the coding processing of the first coding unit101.

Moreover, in the third embodiment, if a difference between the meanvalue E of AVE_(XS)(q) of all the partial regions and the mean valueE_(V) of AVE_(XS)(q) of the partial regions of the valley is greaterthan or equal to the predetermined threshold value TH2_2 which is avalue greater than the threshold value TH2_1, since it is estimated thatthe valley of a spectrum is deep and the spectrum is a spectrum whosespectral envelope has steep ascents and descents or whose degree ofconcentration is high, the suitable coding processing judgment unit 382may judge that the coefficient sequence in the frequency domaincorresponding to the input sound signal of the present frame is suitablefor the coding processing of the first coding unit 101. In this case, ifa difference between the mean value E of AVE_(XS)(q) of all the partialregions and the mean value E_(V) of AVE_(XS)(q) of the partial regionsof the valley is greater than or equal to the threshold value TH2_1 butsmaller than the threshold value TH22, since it is estimated that thedepth of the valley of a spectrum is medium and the spectrum is aspectrum whose spectral envelope has moderate ascents and descents orwhose degree of concentration is medium, the suitable coding processingjudgment unit 382 may perform any one of the coding processing of thefirst coding unit 101 and the coding processing of the second codingunit 201 on the coefficient sequence in the frequency domaincorresponding to the input sound signal of the present frame.

The processing described in the coding device and the coding method maybe performed, in addition to being performed in chronological order inthe order mentioned in the description, in parallel or individuallydepending on the processing power of a device that performs theprocessing or when needed.

Moreover, when the steps in the coding method are implemented by acomputer, the processing details of the functions supposed to beprovided in the coding method are described by a program. As a result ofthis program being executed by the computer, the steps are implementedon the computer.

The program describing the processing details can be recorded on acomputer-readable recording medium. As the computer-readable recordingmedium, any computer-readable recording medium, such as a magneticrecording device, an optical disk, a magneto-optical recording medium,semiconductor memory, or the like, may be used.

Furthermore, each processing means may be configured as a result of apredetermined program being executed on the computer, and at least partof the processing details thereof may be implemented on the hardware.

It goes without saying that changes may be made as appropriate withoutdeparting from the spirit of this invention.

1. A coding method that codes an input sound signal frame by frame of apredetermined time segment by a selected coding processing from aplurality of types of coding processing in a frequency domain, thecoding method comprising: a selection step of making possible aselection to select coding processing which is different from codingprocessing of a preceding frame as coding processing of a present frameif at least one of a magnitude of energy of high frequency components ofan input sound signal of the preceding frame and a magnitude of energyof high frequency components of an input sound signal of the presentframe is smaller than or equal to a predetermined threshold value.
 2. Acoding method that codes an input sound signal frame by frame of apredetermined time segment by a selected coding processing from aplurality of types of coding processing in a frequency domain, thecoding method comprising: a selection step of making possible aselection to select coding processing which is different from codingprocessing of a preceding frame as coding processing of a present frameif at least one of a magnitude of energy of high frequency components ofan input sound signal of the preceding frame and a magnitude of energyof high frequency components of an input sound signal of the presentframe is smaller than or equal to a predetermined threshold value;otherwise, deciding whether to make possible a selection to selectcoding processing which is different from the coding processing of thepreceding frame as the coding processing of the present frame or selecta same coding processing as the coding processing of the preceding frameas the coding processing of the present frame in accordance with a statein which the high frequency components of the input sound signal aresparse.
 3. The coding method according to claim 1 or 2, furthercomprising: a first coding step of coding a coefficient sequence in thefrequency domain corresponding to the input sound signal by using aspectral envelope based on coefficients which are convertible intolinear prediction coefficients corresponding to the input sound signal;and a second coding step of coding the coefficient sequence in thefrequency domain corresponding to the input sound signal, involvingvariable-length coding which is performed on a differential between alogarithmic value of average energy of coefficients in each frequencydomain obtained by division and a logarithmic value of average energy ofan adjacent frequency domain, wherein the selection step further selectsto code the present frame in the second coding step in a case where theinput sound signal of the preceding frame was coded in the first codingstep and an index indicating that ascents and descents of a spectrum ofthe input sound signal of the present frame are steep or a degree ofconcentration of the spectrum is high is smaller than a predeterminedthreshold value, of cases where adopting coding processing which isdifferent from the coding processing of the preceding frame as thecoding processing of the present frame is made possible.
 4. The codingmethod according to claim 1 or 2, further comprising: a first codingstep of coding a coefficient sequence in the frequency domaincorresponding to the input sound signal by using a spectral envelopebased on coefficients which are convertible into linear predictioncoefficients corresponding to the input sound signal; and a secondcoding step of coding the coefficient sequence in the frequency domaincorresponding to the input sound signal, involving variable-lengthcoding which is performed on a differential between a logarithmic valueof average energy of coefficients in each frequency domain obtained bydivision and a logarithmic value of average energy of an adjacentfrequency domain, wherein the selection step further makes possible aselection to code the present frame in the first coding step in a casewhere the input sound signal of the preceding frame was coded in thesecond coding step and an index indicating that ascents and descents ofa spectrum of the input sound signal of the present frame are steep or adegree of concentration of the spectrum is high is greater than or equalto a predetermined threshold value, of cases where adopting codingprocessing which is different from the coding processing of thepreceding frame as the coding processing of the present frame is madepossible.
 5. The coding method according to claim 1 or 2, furthercomprising: a first coding step of coding a coefficient sequence in thefrequency domain corresponding to the input sound signal by using aspectral envelope based on coefficients which are convertible intolinear prediction coefficients corresponding to the input sound signal;and a second coding step of coding the coefficient sequence in thefrequency domain corresponding to the input sound signal, involvingvariable-length coding which is performed on a differential between alogarithmic value of average energy of coefficients in each frequencydomain obtained by division and a logarithmic value of average energy ofan adjacent frequency domain, wherein the selection step further makespossible a selection to code the present frame in the second coding stepin a case where the input sound signal of the preceding frame was codedin the first coding step and an index indicating that ascents anddescents of a spectrum of the input sound signal of the present frameare steep or a degree of concentration of the spectrum is high issmaller than a predetermined first threshold value, of cases whereadopting coding processing which is different from the coding processingof the preceding frame as the coding processing of the present frame ismade possible, and makes possible a selection to code the present framein the first coding step in a case where the input sound signal of thepreceding frame was coded in the second coding step and the indexindicating that the ascents and descents of the spectrum of the inputsound signal of the present frame are steep or the degree ofconcentration of the spectrum is high is greater than or equal to apredetermined second threshold value which is a value greater than thefirst threshold value, of cases where adopting coding processing whichis different from the coding processing of the preceding frame as thecoding processing of the present frame is made possible.
 6. A codingmethod that codes an input sound signal frame by frame of apredetermined time segment by a selected coding processing from aplurality of types of coding processing in a frequency domain, thecoding method comprising: a first coding step of coding a coefficientsequence in the frequency domain corresponding to the input sound signalby using a spectral envelope based on coefficients which are convertibleinto linear prediction coefficients corresponding to the input soundsignal; a second coding step of coding the coefficient sequence in thefrequency domain corresponding to the input sound signal, involvingvariable-length coding which is performed on a differential between alogarithmic value of average energy of coefficients in each frequencydomain obtained by division and a logarithmic value of average energy ofan adjacent frequency domain; and a selection step of making possible aselection to code a present frame in the first coding step if ascentsand descents of a spectrum of the input sound signal of the presentframe are steep or a degree of concentration of the spectrum is high andmaking possible a selection to code the present frame in the secondcoding step if the ascents and descents of the spectrum of the inputsound signal of the present frame are gentle or the degree ofconcentration of the spectrum is low.
 7. The coding method according toclaim 6, wherein the selection step further makes possible a selectionto select a same coding processing as coding processing of a precedingframe as coding processing of the present frame if the ascents anddescents of the spectrum of the input sound signal of the present frameare moderate or the degree of concentration of the spectrum is medium.8. A coding device that codes an input sound signal frame by frame of apredetermined time segment by a selected coding processing from aplurality of types of coding processing in a frequency domain, thecoding device comprising: a selection unit that makes possible aselection to select coding processing which is different from codingprocessing of a preceding frame as coding processing of a present frameif at least one of a magnitude of energy of high frequency components ofan input sound signal of the preceding frame and a magnitude of energyof high frequency components of an input sound signal of the presentframe is smaller than or equal to a predetermined threshold value.
 9. Acoding device that codes an input sound signal frame by frame of apredetermined time segment by a selected coding processing from aplurality of types of coding processing in a frequency domain, thecoding device comprising: a selection unit that makes possible aselection to select coding processing which is different from codingprocessing of a preceding frame as coding processing of a present frameif at least one of a magnitude of energy of high frequency components ofan input sound signal of the preceding frame and a magnitude of energyof high frequency components of an input sound signal of the presentframe is smaller than or equal to a predetermined threshold value;otherwise, selects whether to make possible a selection to select codingprocessing which is different from the coding processing of thepreceding frame as the coding processing of the present frame or selecta same coding processing as the coding processing of the preceding frameas the coding processing of the present frame in accordance with a statein which the high frequency components of the input sound signal aresparse.
 10. The coding device according to claim 8 or 9, furthercomprising: a first coding unit that codes a coefficient sequence in afrequency domain corresponding to the input sound signal by using aspectral envelope based on coefficients which are convertible intolinear prediction coefficients corresponding to the input sound signal;and a second coding unit that codes the coefficient sequence in thefrequency domain corresponding to the input sound signal, involvingvariable-length coding which is performed on a differential between alogarithmic value of average energy of coefficients in each frequencydomain obtained by division and a logarithmic value of average energy ofan adjacent frequency domain, wherein the selection unit further selectsto code the present frame in the second coding unit in a case where theinput sound signal of the preceding frame was coded in the first codingunit and an index indicating that ascents and descents of a spectrum ofthe input sound signal of the present frame are steep or a degree ofconcentration of the spectrum is high is smaller than a predeterminedthreshold value, of cases where adopting coding processing which isdifferent from the coding processing of the preceding frame as thecoding processing of the present frame is made possible.
 11. The codingdevice according to claim 8 or 9, further comprising: a first codingunit that codes a coefficient sequence in a frequency domaincorresponding to the input sound signal by using a spectral envelopebased on coefficients which are convertible into linear predictioncoefficients corresponding to the input sound signal; and a secondcoding unit that codes the coefficient sequence in the frequency domaincorresponding to the input sound signal, involving variable-lengthcoding which is performed on a differential between a logarithmic valueof average energy of coefficients in each frequency domain obtained bydivision and a logarithmic value of average energy of an adjacentfrequency domain, wherein the selection unit further makes possible aselection to code the present frame in the first coding unit in a casewhere the input sound signal of the preceding frame was coded in thesecond coding unit and an index indicating that ascents and descents ofa spectrum of the input sound signal of the present frame are steep or adegree of concentration of the spectrum is high is greater than or equalto a predetermined threshold value, of cases where adopting codingprocessing which is different from the coding processing of thepreceding frame as the coding processing of the present frame is madepossible.
 12. The coding device according to claim 8 or 9, furthercomprising: a first coding unit that codes a coefficient sequence in afrequency domain corresponding to the input sound signal by using aspectral envelope based on coefficients which are convertible intolinear prediction coefficients corresponding to the input sound signal;and a second coding unit that codes the coefficient sequence in thefrequency domain corresponding to the input sound signal, involvingvariable-length coding which is performed on a differential between alogarithmic value of average energy of coefficients in each frequencydomain obtained by division and a logarithmic value of average energy ofan adjacent frequency domain, wherein the selection unit further makespossible a selection to code the present frame in the second coding unitin a case where the input sound signal of the preceding frame was codedin the first coding unit and an index indicating that ascents anddescents of a spectrum of the input sound signal of the present frameare steep or a degree of concentration of the spectrum is high issmaller than a predetermined first threshold value, of cases whereadopting coding processing which is different from the coding processingof the preceding frame as the coding processing of the present frame ismade possible, and makes possible a selection to code the present framein the first coding unit in a case where the input sound signal of thepreceding frame was coded in the second coding unit and the indexindicating that the ascents and descents of the spectrum of the inputsound signal of the present frame are steep or the degree ofconcentration of the spectrum is high is greater than or equal to apredetermined second threshold value which is a value greater than thefirst threshold value, of cases where adopting coding processing whichis different from the coding processing of the preceding frame as thecoding processing of the present frame is made possible.
 13. A codingdevice that codes an input sound signal frame by frame of apredetermined time segment by a selected coding processing from aplurality of types of coding processing in a frequency domain, thecoding device comprising: a first coding unit that codes a coefficientsequence in a frequency domain corresponding to the input sound signalby using a spectral envelope based on coefficients which are convertibleinto linear prediction coefficients corresponding to the input soundsignal; a second coding unit that codes the coefficient sequence in thefrequency domain corresponding to the input sound signal, involvingvariable-length coding which is performed on a differential between alogarithmic value of average energy of coefficients in each frequencydomain obtained by division and a logarithmic value of average energy ofan adjacent frequency domain; and a selection unit that makes possible aselection to code a present frame in the first coding unit if ascentsand descents of a spectrum of the input sound signal of the presentframe are steep or a degree of concentration of the spectrum is high andmakes possible a selection to code the present frame in the secondcoding unit if the ascents and descents of the spectrum of the inputsound signal of the present frame are gentle or the degree ofconcentration of the spectrum is low.
 14. The coding device according toclaim 13, wherein the selection unit further makes possible a selectionto select a same coding processing as coding processing of a precedingframe as coding processing of the present frame if the ascents anddescents of the spectrum of the input sound signal of the present frameare moderate or the degree of concentration of the spectrum is medium.15. (canceled)
 16. A non-transitory computer-readable recording mediumon which a program for making a computer execute each step of the codingmethod according to any one of claims 1, 2, 6 and 7 is recorded.